<!--
function highBG(tar,tarC){
tar.style.backgroundColor = tarC;
}

function pop(gothere,wname,ww,hh){
	var pop_w = ww;
	var pop_h = hh;
	var pop_lw = (screen.width-pop_w)/2+250;
	var pop_lh = ((screen.height-pop_h)/2)-50;

	
	if(pop_lh<0){
		pop_lh=0;
	}
	if(pop_h>=screen.height){
		pop_h=screen.Height-45;
	}
	window.open(gothere,wname,'status=no,scrollbars=yes,menubar=no,resizable=yes,width=' +ww+ ',height=' +hh+ '');

}

function trim(str) {
	return str.replace(/^\s+|\s+$/g, "");
}

function checkEmail(mail_str){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(mail_str)){
		return false;
	}else{
		return true;
	}
}

function checkEmail(mail_str){
	var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
	if (filter.test(mail_str)){
		return false;
	}else{
		return true;
	}
}
/*
function checkEnquiryForm()
{
	var  msg ="";
	var myForm = document.form_Q;
	if (trim(myForm.name.value) == "" )
	{
		msg += "請輸入姓名" + "\n";
	}
	if (trim(myForm.email.value) =="")
	{
		msg += "請輸入電郵地址" + "\n";
	}else{
		if (checkEmail(myForm.email.value))
		{
			msg += "請輸入正確電郵地址" + "\n";
		}
	}
	if (trim(myForm.nationality.value) =="")
	{
		msg += "請輸入國籍" + "\n";
	}

	if (trim(myForm.content.value) =="")
	{
		msg += "請輸入內容" + "\n";
	}
	if (msg!="")
	{
		alert(msg);
		return false;
	}else{
		myForm.action = "main.php?Section=ContactUs&SubSection=Enquiry";
		myForm.submit();
	}
	
}
*/
function CenterResize(ww,hh){
	window.document.focus();
	var pop_w = ww;
	var pop_h = hh;
	var step = 30;
	for(i=1;i<=step;i++){
		var pop_lw = (screen.width-(pop_w*i/step))/2;
		var pop_lh = ((screen.height-(pop_h*i/step))/2)-45;
		if(pop_lh<0){
			pop_lh=0;
		}
		if(pop_h>=screen.height){
			pop_h=screen.Height-45;
		}
		window.resizeTo((pop_w*i/step),(pop_h*i/step));
		window.moveTo(pop_lw,pop_lh);
	}
}

function CenterSize(ww,hh){
	window.document.focus();
	var pop_w = ww;
	var pop_h = hh;
	var pop_lw = (screen.width-pop_w)/2;
	var pop_lh = ((screen.height-pop_h)/2)-45;
	if(pop_lh<0){
		pop_lh=0;
	}
	if(pop_h>=screen.height){
		pop_h=screen.Height-45;
	}
	window.moveTo(pop_lw,pop_lh);
	window.resizeTo(ww,pop_h);
}

//No Text Select
var omitformtags=["input", "textarea", "select"]

function disableselect(e){
for (i = 0; i < omitformtags.length; i++)
if (omitformtags[i]==(e.target.tagName.toLowerCase()))
return;
return false
}

function reEnable(){
return true
}

