// JavaScript Document
/*語系*/
function select_lang(){
	//alert(document.langform.selectLang.options[document.langform.selectLang.selectedIndex].value);
	now=new Date();
　	now.setTime(now.getTime( ) + 1000*60*60*24*7 );
　 	document.cookie="lang="+document.getElementById('selectLang').options[document.getElementById('selectLang').selectedIndex].value+"; expires=" + now.toGMTString( );
	//reload page
	location.reload();

}
/*LOGIN BOX*/
function openLoginBox(){
	var myWidth = 0, myHeight = 0;
  	if( typeof( window.innerWidth ) == 'number' ) {
    	//Non-IE
	    myWidth = window.innerWidth;
    	myHeight = window.innerHeight;
  	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    	//IE 6+ in 'standards compliant mode'
    	myWidth = document.documentElement.clientWidth;
    	myHeight = document.documentElement.clientHeight;
  	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    	//IE 4 compatible
    	myWidth = document.body.clientWidth;
    	myHeight = document.body.clientHeight;
  	}
	
	
	if(document.getElementById('loginBox').style.display == "none" || document.getElementById('loginBox').style.display == ""){
		document.getElementById('loginBox').style.right = ((myWidth-980)/2 - 8)+"px";
		document.getElementById('loginBox').style.display = "block";
		document.topLoginForm.account.focus();
	}else{
		document.getElementById('loginBox').style.display = "none";
	}
}

function submitenter(myfield, e){
	var keycode;
	if (window.event) keycode = window.event.keyCode;
	else if (e) keycode = e.which;
	else return true;
	
	if (keycode == 13){	
		myfield.form.submit();	//IE8 don't work
   		return false;
   	}
	else
   		return true;
}
