/////////////////	onload	/////////////////
window.onload = function (){
var allA = document.getElementById('main').getElementsByTagName('a');
	for(var i=0;i<allA.length;i++){
		allA[i].onmouseover = function (){window.status = this.title;return true}
		allA[i].onmouseout = function (){window.status = '';return true}
	}

/*
window.moveTo(0,0);
if(document.all){
	window.resizeTo(screen.availWidth, screen.availHeight);
}else if(document.layers || document.getElementById){
	if(window.outerHeight < screen.availHeight || window.outerWidth < screen.availWidth){
		window.outerHeight = screen.availHeight;
		window.outerWidth = screen.availWidth;
	}
}
*/
};

/////////////////	end onload	/////////////////

var win=null;
function popWindow(mypage,myname,w,h,scroll){

LeftPosition=(screen.width)?(screen.width-w)/2:100;
TopPosition=(screen.height)?(screen.height-h)/2:100;

settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);

}

//***************

function isEmail(string){
	if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1){
		return true;
	}else{
		return false;
	}
}

//***************

function changeBanner(x){
	document.getElementById("bigPic").innerHTML = document.getElementById('pub0'+x).innerHTML;

	for( var i=1; i<=8; i++ ){
	var dummy = document.getElementById('pub_t_0'+i)
		dummy.style.borderColor = '#8A7763';
		dummy.onmouseover = function(){this.style.borderColor = '#B19B20';}
		dummy.onmouseout = function(){this.style.borderColor = '#8A7763';}
	}

	document.getElementById('pub_t_0'+x).style.borderColor = '#675943';
	document.getElementById('pub_t_0'+x).onmouseover = null;
	document.getElementById('pub_t_0'+x).onmouseout = null;
}

//***************

function submitContact(){

var name = document.getElementById("frmName").value;
var Email = document.getElementById("frmEmail").value;
var msg = document.getElementById("frmMsg").value;
var intWord = "";
var theresult = "pass"
var errorImg = "<img src='images/_error.gif' alt='!' />"

	if(name.length <= 0){
		document.getElementById("error_name").style.display = "block";
		document.getElementById("error_name").innerHTML = errorImg +" Please enter your name.";
		theresult = "not pass"
	}else{
		document.getElementById("error_name").style.display = "none";
		document.getElementById("error_name").innerHTML = intWord;
	}
	if(Email.length <= 0){
		document.getElementById("error_email").style.display = "block";
		document.getElementById("error_email").innerHTML = errorImg +" Please enter your email address.";
		theresult = "not pass"
	}else if(isEmail(Email) == false){
		document.getElementById("error_email").style.display = "block";
		document.getElementById("error_email").innerHTML = errorImg +" This email address is invalid.";
		theresult = "not pass"
	}else{
		document.getElementById("error_email").style.display = "none";
		document.getElementById("error_email").innerHTML = intWord;
	}
	if(msg.length <= 0){
		document.getElementById("error_msg").style.display = "block";
		document.getElementById("error_msg").innerHTML = errorImg +" Please enter your message.";
		theresult = "not pass"
	}else{
		document.getElementById("error_msg").style.display = "none";
		document.getElementById("error_msg").innerHTML = intWord;
	}

if(theresult == "pass"){
	return true;
}else{
	return false;
}

};