function $(id)
{    
    return (typeof id=="string")?document.getElementById(id):id;
}

String.prototype.Trim = function() 
{ 
	return this.replace(/(^\s*)|(\s*$)/g, ""); 
} 


function CheckIsNull(id,msg)
{
    if($(id).value=="")
    {
        $(id).focus();
        alert(msg);       
        return true;
    }
    return false;
    
}

//ÅÐ¶Ïemail
//ÊÇ²»ÊÇemail
function IsEmail(text)
{
	var exp1 = new RegExp("^.{1,40}@.{0,40}$");
 
	var matches1 = text.match(exp1);
 	if( matches1)
	{
		return true;
	}
	return false;
}