var popUpWin=0;
function popUpWindow(URLStr, left, top, width, height)
{
  if(popUpWin)
  {
    if(!popUpWin.closed) popUpWin.close();
  }
  popUpWin = open(URLStr, 'popUpWin', 'menubar=0,scrollbars=1,resizable=1,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
}

function showhide(page)
{
	if(page == 'map')
	{
		document.getElementById('maps').style.display = 'block';	
		document.getElementById('cont').style.display = 'none';				
	}
	else if(page == 'contact')
	{
		document.getElementById('cont').style.display = 'block';	
		document.getElementById('maps').style.display = 'none';
						
	}	
}
function checkEmail(FrmSubmit) {
	
	// Referenced from "http://javascript.internet.com/forms/email-validation---basic.html"

		if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(FrmSubmit.vEmail.value)){
		return (true)
	}
		alert("Invalid E-mail Address! Please re-enter.")
		return (false)
}


function ValidateForm()
{
	if((FrmSubmit.comments.value == "")||(FrmSubmit.name.value == "")||(FrmSubmit.country.value == "")||(FrmSubmit.tel.value == ""))   { 
       	alert('Please fill up the missing field(s).')
	    	return false; 
	 }
  else if(!checkEmail(document.FrmSubmit))
      	return false;
  else	{
   		//alert("Thank you for contacting us.");
   		return true;
 		}
}
