function GoToURL(url)
{
	location=url;
}

function ProcessBookingForm()
{
		if(CheckBookingForm())
		{
		document.booking.submit();
		window.open("thanks.html","thanks","height=520,width=500,statusbar=false");
		window.close('Win1');
		}
}

function ProcessTruckQuote()
{
		document.truckquote.submit();
		window.open("thanks.html","thanks","height=520,width=500,statusbar=false");
		window.close('Win1');
}

function Test()
{

	document.booking.submit();

}

function ProcessTellAFriend()
{
		document.tellafriend.submit();
		window.open("thanks.html","thanks","height=520,width=500,statusbar=false");
		window.close('Win1');
}



function ProcessBoatQuote()
{
		document.boatquote.submit();
		window.open("thanks.html","thanks","height=520,width=500,statusbar=false");
		window.close('Win1');
}


function Popup(url, name, width, height)
{
	settings="toolbar=no,location=no,left=150,top=10,directories=no,"+
	"status=no,menubar=no,scrollbars=yes,"+
	"resizable=no,width="+width+",height="+height;

	MyNewWindow=window.open(url,name,settings);
}

function CheckBookingForm()
{
	isValid=true;	
	for (x=0; x<document.booking.elements.length; x++)
	{
		if(document.booking.elements[x].value == "" )
		{
			if(document.booking.elements[x].name == "Mobile"){continue;}
			if(document.booking.elements[x].name == "Employer"){continue;}
			if(document.booking.elements[x].name == "Work"){continue;}
			if(document.booking.elements[x].name == "Home"){continue;}
			if(document.booking.elements[x].name == "Specific"){continue;}
			
			alert("Sorry, the " +document.booking.elements[x].name+ " field is required. Please try again.")
			document.booking.elements[x].focus()
			isValid=false;
			break;
		}

	}
	return isValid
}

function CheckFriendForm()
{
	isValid=true;
	for (x=0; x<document.tell.elements.length; x++)
	{
		if(document.tell.elements[x].value == "")
		{
			alert("Sorry, the " +document.tell.elements[x].name+ " field is required. Please try again.")
			document.tell.elements[x].focus()
			isValid=false;
			break;
		}
	}
	return isValid;
}

function calculate(name)
{
  var a, b, c;
  a=document.pricing.length.value;
  c="Unable to calculate a price based on that size. Please contact us for a quote."

  if (name==win1) {
  if ((a<24)  ) (alert(c));
  if ((a>=24) & (a<61) ) (b=50*a-600);
  if ((a>=61) & (a<71) ) (b=100*a-3600);
  if ((a>=71) & (a<81) ) (b=200*a-10600);
  if ((a>80)  ) (alert(c)); }

  document.pricing.price.value = b;
  document.pricing.length.focus();
}