function attachXMenu(objid){
 var tds=objid.getElementsByTagName('td');
 for(var i=0;i<tds.length;i++){
  with(tds[i]){
   onmouseover=function(){
    with(this){
     filters[0].apply();
     style.background='#ffff99'; //�����������ȥʱ�ı�����ɫ
     style.border='0 solid #ffffff'; //�߿�
     style.color='black'; //������ɫ
     filters[0].play();
    }
   }
   onmouseout=function(){
    with(this){
     filters[0].apply();
     style.background='#AD8252'; //��������뿪ʱ�ı�����ɫ
     style.border='0 solid #ffffff'; //�߿�
     style.color='#ffffff'; //������ɫ
     filters[0].play();
    }
   }
  }
 }
}

//tree menu
function fnChangeTab(id) {
	 var cla=document.getElementById("s" + id).className;
	 if(cla=="pro_hidden"){
		document.getElementById("t" + id).className="pro_step_1_open";
		document.getElementById("s" + id).className="pro_display";
	 }else{
		document.getElementById("t" + id).className="pro_step_1";
		document.getElementById("s" + id).className="pro_hidden";
	 }
}

function changeBg(id){
	document.getElementById("t" + id).className="change_bg";
}

function recoverBg(id){
	document.getElementById("t" + id).className="pro_step_1";
}

/**
 * Change image width and height if it is biger than normal.
 * @return void
 */
function changeImgSize(){
	img=document.getElementById("bigimg");
	var imgw=img.width;
	var imgh=img.height;
	for(;imgw>590||imgh>550;){
		if(imgw>590){
			imgw=imgw*0.95;
			imgh=imgh*0.95;
		}
		if(imgh>550){
			imgh=imgh*0.95;
			imgw=imgw*0.95;
		}
		if(imgw<590&&imgh<550)
			break;
	}
	img.width=imgw;
	img.height=imgh;
}

/* 弹出登录窗口 */
function openLogin(){
	document.getElementById("protect").style.display = "block";
	document.getElementById("customer_login").style.display = "block";
	document.getElementById("protect").style.height = document.body.scrollHeight+40;
}

function closeLogin(){
	document.getElementById("customer_login").style.display = "none";
	document.getElementById("protect").style.display = "none";
}

/* Check Message */
function checkMessage(){
	if(document.messageForm.name.value==""){
		alert("The name is null!");
		return false;	
	}
	if(document.messageForm.company.value==""){
		alert("The company is null!");
		return false;	
	}
	if(document.messageForm.phone.value==""){
		alert("The phone is null!");
		return false;	
	}
	if(document.messageForm.email.value==""){
		alert("The email is null!");
		return false;	
	}
	if(document.messageForm.description.value==""){
		alert("The message is null!");
		return false;	
	}
	return true;
}
