function check_thisform(){
	var name=document.getElementById("first_loginEmail");
	var pwd=document.getElementById("first_loginPwd");
	
	if(name.value=='帳戶名稱' || name.value=='Account Name')clearDefaultText(name);
	
	if(pwd.value=='default')clearDefaultText(pwd);
	
	var error=false;
	if(name.value==''){
		error=true;
		name.focus();
		if(cl_id=='2'){
			alert('Please enter email address or username');
		}else{
			alert('請輸入用戶電郵地址或登入名稱!');
		}
		
		
	}else if(pwd.value==''){
		error=true;
		pwd.focus();
		if(cl_id=='2'){
			alert('Please enter password');
		}else{
			alert('請輸入用戶密碼!');
		}
		
	}
	
	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;
    }
    }
 }
