var newwindow;
var url;

function OpenNewWindow(url)
{
	newwindow=window.open(url,'name','height=550,width=850,left=50,top=50,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
	if (window.focus) {newwindow.focus()}
}

function PrintWindow()
{
	url=window.location.href
	slashpos=url.lastIndexOf("/")
	leftslice=url.slice(0,slashpos)
	rightslice=url.slice(slashpos,110)
	newurl=leftslice+"/printable"+rightslice
	newwindow=window.open(newurl,'name','height=700,width=670,left=50,top=10,resizable=yes,scrollbars=yes,toolbar=yes,status=yes,location=yes,menubar=yes');
	if (window.focus) {newwindow.focus()}
}

function emailCheck(form)
{
	if(checkRequiredFields(form) == false)
		{ return false; }
	mailcheck = LitForm.email.value;
	if (mailcheck.indexOf("@")<3) {
		alert ("Please make sure you have typed your email address correctly.  Please check the prefix and the '@' sign.")
		LitForm.email.focus()
		return false}
}

function checkRequiredFields(form)
{
	var sError = "";
	if(LitForm.CompanyName.value == "")
	{ sError += "You need to enter a company name.\n"; }
	if(LitForm.Name.value == "")
	{ sError += "You need to enter your name.\n"; }
	if(LitForm.email.value == "")
	{ sError += "You need to enter an email address.\n"; }
	if(LitForm.Telephone.value == "")
	{ sError += "You need to enter a telephone number.\n"; }
	if(sError != "")
	{
		alert(sError);
		return false;
	}
	else
	{ return true; }
}
