function open_window(sURL, iHeight, iWidth, iTop, iLeft, sWinName, sScrollbars, sStatus)
{
	window.open (sURL, sWinName,'height=' + iHeight + ',width=' + iWidth + ',scrollbars=' + sScrollbars + ',toolbar=no,location=no,directories=no,status=' + sStatus + ',menubar=no,titlebar=yes,alwaysRaised=yes,fullscreen=no,resizable=0,top=' + iTop + ',left=' + iLeft);
}

function show_map()
{
	open_window("norwich-web-design-map.asp", 570, 480, 50, 50, "map", "yes", "yes")
}

function show_seo()
{
	open_window("seo-request.asp", 350, 400, 50, 50, "request", "yes", "yes")
}

function validate_email(sEMailAddress)
{
	//var sEmailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]+[\.]+[\\w]+[\\w]$" ;
	var sEmailReg = "^([\.a-zA-Z0-9_-])+@([a-zA-Z0-9_\-])+[\.]+(\.[a-zA-Z0-9])+" ;
	var oRegex = new RegExp(sEmailReg) ;
     
	return (oRegex.test(sEMailAddress)) ;
}

function is_not_empty(sTheString)
{
	return (oNonEmptyRegex.test(sTheString)) ;
}

var oNonEmptyRegex = new RegExp("^[\\w]") ;

function go_validate()
{
	if (document.frmEnquiry)
	{
		if (!is_not_empty(document.frmEnquiry.name.value))
			alert("Please enter your name.") ;
		else if (!is_not_empty(document.frmEnquiry.company.value))
			alert("Please enter your company.") ;
		else if (!is_not_empty(document.frmEnquiry.enquiry.value))
			alert("Please enter your enquiry.") ;
		else if (!is_not_empty(document.frmEnquiry.email.value))
			alert("Please enter a valid email address.") ;
		else if (!is_not_empty(document.frmEnquiry.telNo.value))
			alert("Please enter your telephone number.") ;
		else
			return true ;
	}
	
	return false ;
}

function go_validate_popup()
{
	if (document.frmSeo)
	{
		if (!is_not_empty(document.frmSeo.name.value))
			alert("Please enter your name.") ;
		else if (!is_not_empty(document.frmSeo.company.value))
			alert("Please enter your company.") ;
		else if (!validate_email(document.frmSeo.email.value))
			alert("Please enter a valid email address.") ;
		else if (!is_not_empty(document.frmSeo.telNo.value))
			alert("Please enter your telephone number.") ;
		else
			return true ;
	}
	
	return false ;
}