function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    nbArr = document[grpName];
    if (nbArr)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
      nbArr[nbArr.length] = img;
  } }
}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function checkform()
{

	var erecip = document.theform.Email.value;
	var check = false;

	if (document.theform.Propane.checked)
	{

		check = true;

	}

	if (document.theform.Gas.checked)
	{

		check = true;

	}

	if (document.theform.HeatingOil.checked)
	{

		check = true;

	}

	if (document.theform.RecyclingProgram.checked)
	{

		check = true;

	}

	if (document.theform.FrontEndDisposal.checked)
	{

		check = true;

	}

	if (document.theform.RollOffDisposal.checked)
	{

		check = true;

	}

	if (document.theform.FenceRentals.checked)
	{

		check = true;

	}

	if (document.theform.Other.checked)
	{

		check = true;

	}

	if ( ! check )
	{

		alert("Must select at least one product to be interested in.");
    		document.theform.Name.focus();
		return false;

	}

	if (document.theform.Name.value == "")
  	{
    		alert("Please enter a value for the \"Name\" field.");
    		document.theform.Name.focus();
		return false;

  	}

	if (document.theform.Address.value == "")
  	{
    		alert("Please enter a value for the \"Address\" field.");
    		document.theform.Address.focus();
		return false;

  	}

	if (document.theform.City.value == "")
  	{
    		alert("Please enter a value for the \"City\" field.");
    		document.theform.City.focus();
		return false;

  	}

	if (document.theform.Province.value == "")
  	{
    		alert("Please enter a value for the \"Province\" field.");
    		document.theform.Province.focus();
		return false;

  	}

	if (document.theform.Postalcode.value == "")
  	{
    		alert("Please enter a value for the \"Postal Code\" field.");
    		document.theform.Postalcode.focus();
		return false;

  	}

	if (document.theform.Telephone.value == "")
  	{
    		alert("Please enter a value for the \"Telephone\" field.");
    		document.theform.Telephone.focus();
		return false;

  	}

	if (document.theform.Email.value != "")
  	{
    		if (erecip.indexOf("@") == -1)
		{

			alert("Please enter a VALID email address(someone@somedomain.com).");
    			document.theform.Email.focus();
			return false;

		}

		if (erecip.indexOf(".") == -1)
		{

			alert("Please enter a VALID email address(someone@somedomain.com).");
    			document.theform.Email.focus();
			return false;

		}

		pos   = erecip.lastIndexOf(".");
		token = erecip.substring(pos);
		token2 = token.substring(1);

		if (token2 == "")
		{

			alert("Please enter a VALID email address(someone@somedomain.com).");
    			document.theform.Email.focus();
			return false;

		}

	}

}

function checkformFence()
{

	var erecip  = document.theform.BillingEmail.value;
	var erecip1 = document.theform.FirstEmail.value;
	var erecip2 = document.theform.SecondEmail.value;
		
	if (document.theform.JobName.value == "")
  	{
    		alert("Please enter a value for the \"Job Name\" field.");
    		document.theform.JobName.focus();
		return false;
		
  	}

	if (document.theform.SiteAddress.value == "")
  	{
    		alert("Please enter a value for the \"Special Event Address\" field.");
    		document.theform.SiteAddress.focus();
		return false;
		
  	}
	
	if (document.theform.SiteCity.value == "")
  	{
    		alert("Please enter a value for the \"Special Event City\" field.");
    		document.theform.SiteCity.focus();
		return false;
		
  	}
	
	if (document.theform.SiteProvince.value == "")
  	{
    		alert("Please enter a value for the \"Special Event Province\" field.");
    		document.theform.SiteProvince.focus();
		return false;
		
  	}
	
	if (document.theform.Company.value == "")
  	{
    		alert("Please enter a value for the \"Company Name\" field.");
    		document.theform.Company.focus();
		return false;
		
  	}
	
	if (document.theform.BillingAddress.value == "")
  	{
    		alert("Please enter a value for the \"Company Billing Address\" field.");
    		document.theform.BillingAddress.focus();
		return false;
		
  	}
	
	if (document.theform.BillingCity.value == "")
  	{
    		alert("Please enter a value for the \"Company Billing City\" field.");
    		document.theform.BillingCity.focus();
		return false;
		
  	}
	
	if (document.theform.BillingProvince.value == "")
  	{
    		alert("Please enter a value for the \"Company Billing Province\" field.");
    		document.theform.BillingProvince.focus();
		return false;
		
  	}
	
	if (document.theform.BillingTelephone.value == "")
  	{
    		alert("Please enter a value for the \"Company Billing Telephone\" field.");
    		document.theform.BillingTelephone.focus();
		return false;
		
  	}
		
	if (document.theform.BillingEmail.value == "")
  	{
    		alert("Please enter a value for the \"Company Billing E-mail\" field.");
    		document.theform.BillingEmail.focus();
		return false;
		
  	}
	
	if (document.theform.BillingPostalcode.value == "")
  	{
    		alert("Please enter a value for the \"Company Billing Postal Code\" field.");
    		document.theform.BillingPostalcode.focus();
		return false;
		
  	}
	
	if (document.theform.FirstContact.value == "")
  	{
    		alert("Please enter a value for the \"First Contact Name\" field.");
    		document.theform.FirstContact.focus();
		return false;
		
  	}
	if (document.theform.FirstTitle.value == "")
  	{
    		alert("Please enter a value for the \"First Contact Title\" field.");
    		document.theform.FirstTitle.focus();
		return false;
		
  	}
	if (document.theform.FirstPhone.value == "")
  	{
    		alert("Please enter a value for the \"First Contact Phone\" field.");
    		document.theform.FirstPhone.focus();
		return false;
		
  	}
	
	if (document.theform.SecondContact.value == "")
  	{
    		alert("Please enter a value for the \"Second Contact Name\" field.");
    		document.theform.SecondContact.focus();
		return false;
		
  	}
	if (document.theform.SecondTitle.value == "")
  	{
    		alert("Please enter a value for the \"Second Contact Title\" field.");
    		document.theform.SecondTitle.focus();
		return false;
		
  	}
	if (document.theform.SecondPhone.value == "")
  	{
    		alert("Please enter a value for the \"Second Contact Phone\" field.");
    		document.theform.SecondPhone.focus();
		return false;
		
  	}
	
	if (document.theform.Setup.value == "")
  	{
    		alert("Please enter a value for the \"Setup Data and Time\" field.");
    		document.theform.Setup.focus();
		return false;
		
  	}
	if (document.theform.TearDown.value == "")
  	{
    		alert("Please enter a value for the \"Tear Down Date and Time\" field.");
    		document.theform.TearDown.focus();
		return false;
		
  	}
	
	if (document.theform.BillingEmail.value != "")
  	{
    		if (erecip.indexOf("@") == -1)
		{
	
			alert("Please enter a VALID company billing email address(someone@somedomain.com).");
    			document.theform.BillingEmail.focus();
			return false;
		
		}
	
		if (erecip.indexOf(".") == -1)
		{
	
			alert("Please enter a VALID company billing email address(someone@somedomain.com).");
    			document.theform.BillingEmail.focus();
			return false;
		
		}
	
		pos   = erecip.lastIndexOf(".");
		token = erecip.substring(pos);
		token2 = token.substring(1);
	
		if (token2 == "")
		{
	
			alert("Please enter a VALID company billing email address(someone@somedomain.com).");
    			document.theform.BillingEmail.focus();
			return false;
		
		}
	
	}

	if (document.theform.FirstEmail.value != "")
  	{
    		if (erecip1.indexOf("@") == -1)
		{
	
			alert("Please enter a VALID first contact email address(someone@somedomain.com).");
    			document.theform.FirstEmail.focus();
			return false;
		
		}
	
		if (erecip1.indexOf(".") == -1)
		{
	
			alert("Please enter a VALID first contact email address(someone@somedomain.com).");
    			document.theform.FirstEmail.focus();
			return false;
		
		}
	
		pos   = erecip1.lastIndexOf(".");
		token = erecip1.substring(pos);
		token2 = token.substring(1);
	
		if (token2 == "")
		{
	
			alert("Please enter a VALID first contact email address(someone@somedomain.com).");
    			document.theform.FirstEmail.focus();
			return false;
		
		}
	
	}
	
	if (document.theform.SecondEmail.value != "")
  	{
    		if (erecip2.indexOf("@") == -1)
		{
	
			alert("Please enter a VALID second contact email address(someone@somedomain.com).");
    			document.theform.SecondEmail.focus();
			return false;
		
		}
	
		if (erecip2.indexOf(".") == -1)
		{
	
			alert("Please enter a VALID second contact email address(someone@somedomain.com).");
    			document.theform.SecondEmail.focus();
			return false;
		
		}
	
		pos   = erecip2.lastIndexOf(".");
		token = erecip2.substring(pos);
		token2 = token.substring(1);
	
		if (token2 == "")
		{
	
			alert("Please enter a VALID second contact email address(someone@somedomain.com).");
    			document.theform.SecondEmail.focus();
			return false;
		
		}
	
	}
}

