﻿// JScript 文件

function GetSize(obj,w,h)
{
    var photoUrl=obj.src;
    var image = new Image();//new一个image对象        
    image.src=obj.src;
    var widths= obj.width;
    var heights = obj.height;
  	
    if (widths <w && heights <h)
    {  
        obj.width=obj.width; 
        obj.height=obj.height; 
    }
    else if(widths >w && heights >h)
    {  
        var scale = w/widths;
        var NowH =(heights*scale); 
        var NowW =(widths*scale); 
        if (NowH >h )
        {
            obj.height=h; 
        }
        else if(NowW >w)
        {
             obj.width=w; 
        }
        else 
        {
            obj.width=w; 
        }
    } 
    else if(widths >w)
    {  
        obj.width=w; 
    }
    else if(heights >h)
    {  
        obj.height=h; 
    } 
}


function checkFromMeg()
{
    if ($("ctl00_ContentPlaceHolder1_TextBox1").value =="")
    {
        alert('Content不能为空'); 
        $("ctl00_ContentPlaceHolder1_TextBox1").focus();
        return false;        
    }
    else if ($("ctl00_ContentPlaceHolder1_TextBox2").value =="")
    {
        alert('Company name不能为空'); 
        $("ctl00_ContentPlaceHolder1_TextBox2").focus();
        return false;           
    }
    else if ($("ctl00_ContentPlaceHolder1_TextBox3").value =="")
    {
        alert('Contact不能为空'); 
        $("ctl00_ContentPlaceHolder1_TextBox3").focus();
        return false;           
    }
    else if ($("ctl00_ContentPlaceHolder1_TextBox4").value =="")
    {
        alert('Tel不能为空'); 
        $("ctl00_ContentPlaceHolder1_TextBox4").focus();
        return false;           
    }
    else if ($("ctl00_ContentPlaceHolder1_TextBox5").value =="")
    {
        alert('E-mail不能为空'); 
        $("ctl00_ContentPlaceHolder1_TextBox5").focus();
        return false;           
    }
}

