function check_thisform(){
	if(window.cl_id=='1'){
		var please_enter_email = '請輸入用戶電郵地址或登入名稱!';
		var please_enter_password = '請輸入用戶密碼!';
	}	
	else{
		var please_enter_email = 'Please enter email address or username!';
		var please_enter_password = 'Please enter password.';
	}
		
	var name=document.getElementById("first_loginEmail");
	var pwd=document.getElementById("first_loginPwd");
	
	if(name.value=='帳戶名稱')clearDefaultText(name);
	
	if(pwd.value=='default')clearDefaultText(pwd);
	
	var error=false;
	if(name.value==''){
		error=true;
		name.focus();
	
		alert(please_enter_email);
	
		
	}else if(pwd.value==''){
		error=true;
		pwd.focus();
		alert(please_enter_password);
	}
	
	if(error)	return false;
	
	return true;
}
 
 function showBox(p_id){
    overlay=document.createElement('div');
    overlay.id='overlay';
   
    addLightboxMarkup();
	if(is_ie()){
	overlay.style.filter='Alpha(opacity=50)';
	}else{
	overlay.style.cssText='position: fixed;z-index:100;top: 0px;left: 0px;height:100%;width:100%;background-color:#000;filter:alpha(opacity=40);-moz-opacity: 0.40;opacity: 0.40;';
	}
	overlay.style.width=window.screen.width;
	overlay.style.display ="block";
	progress(p_id);
 }
 
 
 function addLightboxMarkup() {
  var bod= document.getElementsByTagName('body')[0];
  bod.appendChild(overlay);
 }
 
 function progress(p_id){
  var temp_h1 = document.body.clientHeight;
  var temp_h2 = document.documentElement.clientHeight;
  var isXhtml = (temp_h2<=temp_h1&&temp_h2!=0)?true:false; 
  var htmlbody = isXhtml?document.documentElement:document.body;
  //window.scrollTo(0,this.yPos);
  htmlbody.style.cssText="overflow-x:hidden;"; 
 }

 function findwindow(){
   if(open_html==null||open_html.closed){
   	var d=document.getElementById('overlay');
   	var p=d.parentNode;
   	p.removeChild(d);
    window.clearInterval(timer);
    
	//get_cart();
    show_hidden_select('visible');
   document.documentElement.style.overflow="auto";
  }
 }

 function show_hidden_select(show_hidden_flag){
	selects = document.getElementsByTagName('select');
    if(selects!='null'){
    for(i = 0; i < selects.length; i++) {
       selects[i].style.visibility = show_hidden_flag;
    }
    }
 }