		   function menuOver(id)
		   {
		     for(i=1;i<=8;i++)
			 {
			   if(i==id)
			   {
			     document.all['menu'+i].background='images/Cn_Menu_Left_over.gif';
			   }
			   else
			   {
			     document.all['menu'+i].background='images/Cn_Menu_Left_out.gif';
			   }
			 }
		   }
		   
		   function menuOut()
		   {
		     for(i=1;i<=8;i++)
			 {
			   if(i==page)
			   {
			     document.all['menu'+i].background='images/Cn_Menu_Left_over.gif';
			   }
			   else
			   {
			     document.all['menu'+i].background='images/Cn_Menu_Left_out.gif';
			   }
			 }
		   }


var flag=false;
function DrawImage(ImgD,x,y){
   var image=new Image();
   image.src=ImgD.src;
   if(image.width>0 && image.height>0){
    flag=true;
    if(image.width/image.height>= x/y){
     if(image.width>x){  
     ImgD.width=x;
     ImgD.height=(image.height*x)/image.width;
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     ImgD.alt=image.width+"x"+image.height;
     }
    else{
     if(image.height>y){  
     ImgD.height=y;
     ImgD.width=(image.width*y)/image.height;     
     }else{
     ImgD.width=image.width;  
     ImgD.height=image.height;
     }
     ImgD.alt=image.width+"x"+image.height;
     }
    }
} 

function chkemail(a)
{

	var i=a.length;

	var temp = a.indexOf('@');
	//var tempd = a.indexOf('.');
	var tempd = a.indexOf('.');

	if (tempd > 0) {
		tempd = (a.substring(temp)).indexOf('.');
		
		if (temp > 1) {
		
			if ((i-temp) > 7){
				if (tempd > 2){
				
					if ((i-temp-tempd)>2){
						return 1;
					}
				}
			}
		}

	}
	
	return 0;
	
}

function phone(phone)
{
    var phoneNum = "1234567890()-";
    var temp;
    if (phone.length < 7)
    {
         return (false);
    }
    for (var i = 0; i < phone.length; i++)
    {
        temp = phone.substring(i,i+1);
        if (phoneNum.indexOf(temp) == -1)
        {
            return (false);
        }
    }
}


function fucCheckTel(Tel)
{
	var i,j,strTemp;
	strTemp="0123456789-#() ";
	if (Tel.length < 7 )
	{
	 return 0;
	 }
	for (i=0;i<Tel.length;i++)
	{
		j=strTemp.indexOf(Tel.charAt(i));	
		if (j==-1)
		{
			return 0;
		}
	}
	return 1;
}
