<!-- Hide script from old browsers
// Make sure file is not hosted in a different frameset
if ( top.location.href != window.location.href )
  { top.location.href=window.location.href }

    function openWindow(url, w, h) {
        var windowprops = "width=" + w + ",height=" + h +",,left=10,top=10,scrollbars=no,status=yes,toolbar=no,location=no,directories=no,resizable=yes";
          popup = window.open(url,'newWin',windowprops);
          popup.focus();
           } 
        
	function openPicture(pic,w,h) {
     
     	var wpro = w + 20;
     	var hpro = h + 50;
		var windowprops = "left=160,top=50,scrollbars=no,status=no,toolbar=no,location=no,directories=no,resizable=no,width=" + wpro + ",height=" + hpro;
          
		picture = window.open('','newPicture',windowprops);
		picture.close();
        picture = window.open('','newPicture',windowprops);  
        picture.focus();
        
		picture.document.write("<html><head><title>Picture<\/title><link href='common\/cstyle.css' type=text\/css rel=stylesheet><\/head><body leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'bgcolor='#000000'>")
		picture.document.writeln("<table width='100%' border='0' cellpadding='5'><tr><td align='center' valign='middle'>")
		picture.document.writeln("<img src=" + pic + " width=" + w + " height=" + h + "></td></tr></table>")
		picture.document.write("<center><a href='#' OnClick='window.close();' class='messageLink'>Close</a></center>")
		picture.document.write("<\/body><\/html>")
	}                
 
function showdate()
{
	
		// Determine the current date and display it
   	var today = new Date();
   	var day = today.getDay();
   	var date = today.getDate();
   	var month = today.getMonth();
   	var year = today.getFullYear();
   	
   		//January,February,March,April,May,June,July,August,September,October,November,December
   	if (month == 0) {month='Jan'};
   	if (month == 1) {month='Feb'};
   	if (month == 2) {month='Mar'};
   	if (month == 3) {month='Apr'};
   	if (month == 4) {month='May'};
   	if (month == 5) {month='Jun'};
   	if (month == 6) {month='Jul'};
   	if (month == 7) {month='Aug'};
   	if (month == 8) {month='Sept'};
   	if (month == 9) {month='Oct'};
   	if (month == 10) {month='Nov'};
   	if (month == 11) {month='Dec'};
   
   	if (day == 0) {day='Sunday'};
   	if (day == 1) {day='Monday'};
   	if (day == 2) {day='Tuesday'};
   	if (day == 3) {day='Wednesday'};
   	if (day == 4) {day='Thursday'};
   	if (day == 5) {day='Friday'};
   	if (day == 6) {day='Saturday'};
   
   if ( document.all ) {
		document.write ('<span class="small">&nbsp;&nbsp;' + day + ', ' + month +  ' ' + date + ', ' + year + '</span>');
	} else {
		document.write ('<span class="smallNC">&nbsp;&nbsp;' + day + ', ' + month +  ' ' + date + ', ' + year +  '</span>');
	}
   
   
}

function switchClass(obj,strClassName) {
		obj.className	= strClassName;
	}
	
function gotoURL(strUrl) {
		location = strUrl;
	}

function copyrightYear(startYear)
	{
		d = new Date();
		
		if (startYear != d.getFullYear())
			{
			return startYear + " - " + d.getFullYear();
			}
		else
			{
			return startYear;
			}
	}
	
	// Show current date in format "Nov 15, 2003".		
function nsDate()
{
		// Get today's date.
	var sDate = new Date();
	var sToday = "";
	
		// Array with months.
	var aMonths = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	
		// Get current month.
	var iMonth = sDate.getMonth();
		
		// Get current hour,minute,second.
	var iHours   = sDate.getHours();
	var iMinutes = sDate.getMinutes();
	var iSeconds = sDate.getSeconds();
			
	sToday = "";
		// Get today's date string.
	sToday += aMonths[iMonth] + " ";
	sToday += sDate.getDate() + ", ";
	sToday += sDate.getFullYear() + " ";

		// Display the date on the screen.
	document.write("<b>"+sToday+"</b>");	
}

	// Get the current date in format "Nov 15, 2003  12:53:23 pm".
function today()
{
	var ie4=document.all;
    var ns4=document.layers;
    var ns6=document.getElementById&&!document.all;
    	
		// Get today's date.
	var sDate = new Date();
	var sToday = "";
	
		// Array with months.
	var aMonths = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
	
		// Get current month.
	var iMonth = sDate.getMonth();
		
		// Get current hour,minute,second.
	var iHours   = sDate.getHours();
	var iMinutes = sDate.getMinutes();
	var iSeconds = sDate.getSeconds();
	
		// If iHour > 12.
	if(iHours>12)
		iHours = iHours - 12;
	
	if(iMinutes < 10)
		iMinutes = "0" + iMinutes;
		
	if(iSeconds < 10)
		iSeconds = "0" + iSeconds;
	
	sToday = "";
		// Get today's date string.
	sToday += aMonths[iMonth] + " ";
	sToday += sDate.getDate() + ", ";
	sToday += sDate.getFullYear() + " ";
	
	sToday += iHours + ":";
	sToday += iMinutes + ":" ;
	sToday += iSeconds; 

	
		// Set am or pm
	if(sDate.getHours() < 12)
		sToday += " am ";
	else
		sToday += " pm ";
	
		// Display the date on the screen.
	
		// Write the clock to the layer:
	if (ns4) 
	{
		return;
	} 
	else 
		if (ie4) 
		{
			document.getElementById("LiveClock").innerHTML = "<b>"+sToday+"</b>";
		}	 
		else 
			if (ns6)
			{
				document.getElementById("LiveClock").innerHTML = "<b>"+sToday+"</b>";
            }            
	
		setTimeout("today()",1000);
		//window.setInterval(today(),100);
}

function checkRegForm(form)
{
	/*
	pq = form.PQ.value;
	if (pq == "")
	{
		alert("Please, enter PQ.");
		form.PQ.focus();
		return false;
	}
	*/
	
	/*
	pq2 = form.PQ2.value;
	if (pq2 == "")
	{
		alert("Please, enter PQ.");
		form.PQ2.focus();
		return false;
	}
	*/
	
	/*
	cp = form.CP.value;
	if (cp == "")
	{
		alert("Please, enter CP.");
		form.CP.focus();
		return false;
	}
	
	rp = form.RP.value;
	if (rp == "")
	{
		alert("Please, enter RP.");
		form.RP.focus();
		return false;
	}
	
	svc = form.SVC.value;
	if (svc == "")
	{
		alert("Please, enter SVC.");
		form.SVC.focus();
		return false;
	}
	
	sp = form.SP.value;
	if (sp == "")
	{
		alert("Please, enter SP.");
		form.SP.focus();
		return false;
	}
	
	sp = form.SP.value;
	if (sp == "")
	{
		alert("Please, enter SP.");
		form.SP.focus();
		return false;
	}
	*/
	
	ctChecked = false;
	for (i = 0; i < form.CustomerType.length; i++)
	{
		if (form.CustomerType[i].checked == true)
		{
			ctChecked = true;
		}
	}
	if (!ctChecked)
	{
		alert("Please, choose customer type.");		
		return false;
	}
	
	snChecked = false;
	for (i = 0; i < form.Needed.length; i++)
	{
		if (form.Needed[i].checked == true)
		{
			snChecked = true;
		}
	}
	if (!snChecked)
	{
		alert("Please, choose what type of service do you need.");		
		return false;
	}
	
	servicemonth = form.ServiceMonth.value;
	if (servicemonth == "0")
	{
		alert("Please, choose month when the service is needed.");
		form.ServiceMonth.focus();
		return false;
	}
	
	serviceday = form.ServiceDay.value;
	if (serviceday == "0")
	{
		alert("Please, choose date when the service is needed.");
		form.ServiceDay.focus();
		return false;
	}
	
	serviceyear = form.ServiceYear.value;
	if (serviceyear == "0")
	{
		alert("Please, choose year when the service is needed.");
		form.ServiceYear.focus();
		return false;
	}
	
	lastname = form.LastName.value;
	if (lastname == "")
	{
		alert("Please, enter last name.");
		form.LastName.focus();
		return false;
	}
	
	firstname = form.FirstName.value;
	if (firstname == "")
	{
		alert("Please, enter first name.");
		form.FirstName.focus();
		return false;
	}
	
	/*
	spouse = form.Spouse.value;
	if (spouse == "")
	{
		alert("Please, enter spouse name.");
		form.Spouse.focus();
		return false;
	}
	*/
	
	deliveryaddress = form.DeliveryAddress.value;
	if (deliveryaddress == "")
	{
		alert("Please, enter delivery address.");
		form.DeliveryAddress.focus();
		return false;
	}
	
	locatedbetween = form.LocatedBetween.value;
	if (locatedbetween == "")
	{
		alert("Please, enter where located.");
		form.LocatedBetween.focus();
		return false;
	}
	
	city = form.City.value;
	if (city == "")
	{
		alert("Please, enter city.");
		form.City.focus();
		return false;
	}
	
	state = form.State.value;
	if (state == "")
	{
		alert("Please, enter state.");
		form.State.focus();
		return false;
	}
	
	zip = form.Zip.value;
	if (zip == "")
	{
		alert("Please, enter zip code.");
		form.Zip.focus();
		return false;
	}
	
	specialinstructions = form.SpecialInstructions.value;
	if (specialinstructions != "" && specialinstructions.length > 500)
	{
		alert("Please, enter shorter special instructions. Maximul length is 500 characters.");
		form.SpecialInstructions.focus();
		return false;
	}
	
	billingaddress = form.BillingAddress.value;
	if (billingaddress == "")
	{
		alert("Please, enter billing address.");
		form.BillingAddress.focus();
		return false;
	}
	
	billingcity = form.BillingCity.value;
	if (billingcity == "")
	{
		alert("Please, enter city for biling.");
		form.BillingCity.focus();
		return false;
	}
	
	billingstate = form.BillingState.value;
	if (billingstate == "")
	{
		alert("Please, enter state for billing.");
		form.BillingState.focus();
		return false;
	}
	
	billingzip = form.BillingZip.value;
	if (billingzip == "")
	{
		alert("Please, enter zip code for billing.");
		form.BillingZip.focus();
		return false;
	}
	
	homephone = form.HomePhone.value;
	if (homephone == "")
	{
		alert("Please, enter home phone number.");
		form.HomePhone.focus();
		return false;
	}
	
	workphone = form.WorkPhone.value;
	if (workphone == "")
	{
		alert("Please, enter work phone number.");
		form.WorkPhone.focus();
		return false;
	}
	
	email = form.Email.value;
	/*
	if (email == "")
	{
		alert("Please, enter e-mail address.");
		form.Email.focus();
		return false;
	}
	*/
	
	if (email != "")
	{
		if ((email.length < 3) || (email.length > 50) || 
			(email.charAt(0) == '@') || (email.charAt(email.length-1) == '@') || 
			(email.charAt(0) == '.') || (email.charAt(email.length-1) == '.') || 
			(email.indexOf('.') == -1) || (email.indexOf('@') == -1) ||
			(email.indexOf('@') != email.lastIndexOf('@')) || 
			(email.indexOf(' ') > 0) || (email.indexOf('?') > 0) || (email.indexOf('..') > 0)
			)
		{
			alert("Please, enter correct e-mail address.");
			form.Email.focus();
			return false;
		}
	}
	
	formeroilsupplier = form.FormerOilSupplier.value;
	if (formeroilsupplier == "")
	{
		alert("Please, enter former oil supplier.");
		form.FormerOilSupplier.focus();
		return false;
	}
	
	lastdeliverymonth = form.LastDeliveryMonth.value;
	if (lastdeliverymonth == "0")
	{
		alert("Please, enter month of last delivery.");
		form.LastDeliveryMonth.focus();
		return false;
	}
	
	lastdeliveryday = form.LastDeliveryDay.value;
	if (lastdeliveryday == "0")
	{
		alert("Please, enter date of last delivery.");
		form.LastDeliveryDay.focus();
		return false;
	}
	
	lastdeliveryyear = form.LastDeliveryYear.value;
	if (lastdeliveryyear == "0")
	{
		alert("Please, enter year of last delivery.");
		form.LastDeliveryYear.focus();
		return false;
	}
	
	referredby = form.ReferredBy.value;
	if (referredby == "")
	{
		alert("Please, enter who reffered you.");
		form.ReferredBy.focus();
		return false;
	}
	
	dyChecked = false;
	for (i = 0; i < form.DogInYard.length; i++)
	{
		if (form.DogInYard[i].checked == true)
		{
			dyChecked = true;
		}
	}
	if (!dyChecked)
	{
		alert("Please, choose is there a dog in the yard.");		
		return false;
	}
	
	kgChecked = false;
	for (i = 0; i < form.KeyForGate.length; i++)
	{
		if (form.KeyForGate[i].checked == true)
		{
			kgChecked = true;
		}
	}
	if (!kgChecked)
	{
		alert("Please, choose do we need a key for a door or gate.");		
		return false;
	}
	
	ftChecked = false;
	for (i = 0; i < form.FuelTankSize.length; i++)
	{
		if (form.FuelTankSize[i].checked == true)
		{
			ftChecked = true;
		}
	}
	
	othertanksize = form.OtherTankSize.value;
	if (othertanksize == "" && !ftChecked)
	{
		alert("Please, choose fuel tank size or enter other tank size.");
		form.OtherTankSize.focus();
		return false;
	}
	
	oilperyear = form.OilPerYear.value;
	if (oilperyear == "")
	{
		alert("Please, enter approximate oil consumed per year.");
		form.OilPerYear.focus();
		return false;
	}
	
	dtChecked = false;
	for (i = 0; i < form.DeliveryType.length; i++)
	{
		if (form.DeliveryType[i].checked == true)
		{
			dtChecked = true;
		}
	}
	if (!dtChecked)
	{
		alert("Please, choose type of delivery.");		
		return false;
	}
	
	utChecked = false;
	for (i = 0; i < form.UndergroundOilTank.length; i++)
	{
		if (form.UndergroundOilTank[i].checked == true)
		{
			utChecked = true;
		}
	}
	if (!utChecked)
	{
		alert("Please, choose do you have underground oil tank.");		
		return false;
	}
	
	ofChecked = false;
	for (i = 0; i < form.OilFillPosition.length; i++)
	{
		if (form.OilFillPosition[i].checked == true)
		{
			ofChecked = true;
		}
	}
	if (!ofChecked)
	{
		alert("Please, choose oil fill position.");		
		return false;
	}
	
	hwChecked = false;
	for (i = 0; i < form.HeatWater.length; i++)
	{
		if (form.HeatWater[i].checked == true)
		{
			hwChecked = true;
		}
	}
	if (!hwChecked)
	{
		alert("Please, choose do you heat your water with oil.");		
		return false;
	}
	
	shChecked = false;
	for (i = 0; i < form.SeparateHeater.length; i++)
	{
		if (form.SeparateHeater[i].checked == true)
		{
			shChecked = true;
		}
	}
	if (!shChecked)
	{
		alert("Please, choose do you have separate oil-fired hot water heater.");		
		return false;
	}
	
	birthmonth = form.BirthMonth.value;
	if (birthmonth == "0")
	{
		alert("Please, select owner month of birth.");
		form.BirthMonth.focus();
		return false;
	}
	
	birthday = form.BirthDay.value;
	if (birthday == "0")
	{
		alert("Please, select owner date of birth.");
		form.BirthDay.focus();
		return false;
	}
	
	birthyear = form.BirthYear.value;
	if (birthyear == "0")
	{
		alert("Please, select owner year of birth.");
		form.BirthYear.focus();
		return false;
	}
	
	/*
	spousess = form.SpouseSS.value;
	if (spousess == "")
	{
		alert("Please, enter spouse SS#.");
		form.SpouseSS.focus();
		return false;
	}
	
	spousebirthmonth = form.SpouseBirthMonth.value;
	if (spousebirthmonth == "0")
	{
		alert("Please, enter spouse month of birth.");
		form.SpouseBirthMonth.focus();
		return false;
	}
	
	spousebirthday = form.SpouseBirthDay.value;
	if (spousebirthday == "0")
	{
		alert("Please, enter spouse date of birth.");
		form.SpouseBirthDay.focus();
		return false;
	}
	
	spousebirthyear = form.SpouseBirthYear.value;
	if (spousebirthyear == "0")
	{
		alert("Please, enter spouse year of birth.");
		form.SpouseBirthYear.focus();
		return false;
	}
	*/
	
	employmentplace = form.EmploymentPlace.value;
	if (employmentplace == "")
	{
		alert("Please, enter employment place.");
		form.EmploymentPlace.focus();
		return false;
	}
	
	position = form.Position.value;
	if (position == "")
	{
		alert("Please, enter employment position.");
		form.Position.focus();
		return false;
	}
	
	creditcard = form.CreditCard.value;
	cardexpmonth = form.CardExpMonth.value;
	cardexpyear = form.CardExpYear.value;
	
	if ((cardexpmonth == "0" || cardexpyear == "0"))
	{
		alert("Please, select month and year of card expire date.");
		form.CardExpMonth.focus();
		return false;
	}
	
	if (creditcard == "")
	{
		alert("Please, enter credit card number.");
		form.CreditCard.focus();
		return false;
	}
	
	if (cardexpmonth != "0" || cardexpyear != "0" || creditcard != "")
	{
		/*
		if ((cardexpmonth == "0" || cardexpyear == "0"))
		{
			alert("Please, select month and year of card expire date.");
			form.CardExpMonth.focus();
			return false;
		}
		
		if (creditcard == "")
		{
			alert("Please, enter credit card number.");
			form.CreditCard.focus();
			return false;
		}
		*/
	}
	else
	{
		/*
		ownerss = form.OwnerSS.value;
		if (ownerss == "")
		{
			alert("Please, enter owner SS#.");
			form.OwnerSS.focus();
			return false;
		}
		*/
	}
	
	cdChecked = false;
	for (i = 0; i < form.AutoCardDeduction.length; i++)
	{
		if (form.AutoCardDeduction[i].checked == true)
		{
			cdChecked = true;
		}
	}
	if (!cdChecked)
	{
		alert("Please, choose automatic credit card deduction on all deliveries.");		
		return false;
	}
	
	ccChecked = false;
	for (i = 0; i < form.ChargeCard.length; i++)
	{
		if (form.ChargeCard[i].checked == true)
		{
			ccChecked = true;
		}
	}
	if (!ccChecked)
	{
		alert("Please, choose do you wish to charge your credit card one time.");		
		return false;
	}
	
	inspection = form.Inspection.value;
	inspectbetween = form.InspectBetween.value;
	inspectand = form.InspectAnd.value;
	if (inspection != "" || inspectbetween != "" || inspectand != "")
	{
		if (inspection == "")
		{
			alert("Please, enter when inspection is set for.");
			form.Inspection.focus();
			return false;
		}
		if (inspectbetween == "")
		{
			alert("Please, enter between when inspection is set for.");
			form.InspectBetween.focus();
			return false;
		}
		if (inspectand == "")
		{
			alert("Please, enter time period between when inspection is set for.");
			form.InspectAnd.focus();
			return false;
		}
	}
	
	customername = form.CustomerName.value;
	if (customername == "")
	{
		alert("Please, enter your name at the bottom of the form.");
		form.CustomerName.focus();
		return false;
	}
}
// **********************************************************************
function checkContactForm(form)
{
	contactname = form.ContactName.value;
	if (contactname == "")
	{
		alert("Please, enter your name.");
		form.ContactName.focus();
		return false;
	}
	
	address1 = form.Address1.value;
	if (address1 == "")
	{
		alert("Please, enter your address.");
		form.Address1.focus();
		return false;
	}
	
	city = form.City.value;
	if (city == "")
	{
		alert("Please, enter your city.");
		form.City.focus();
		return false;
	}
	
	state = form.State.value;
	if (state == "")
	{
		alert("Please, enter your state.");
		form.State.focus();
		return false;
	}
	
	zip = form.Zip.value;
	if (zip == "")
	{
		alert("Please, enter your zip code.");
		form.Zip.focus();
		return false;
	}
	
	country = form.Country.value;
	if (country == "")
	{
		alert("Please, enter your country.");
		form.Country.focus();
		return false;
	}
	
	phone = form.Phone.value;
	if (phone == "")
	{
		alert("Please, enter your phone number.");
		form.Phone.focus();
		return false;
	}
	
	
	email = form.Email.value;
	/*
	if (email == "")
	{
		alert("Please, enter your e-mail address.");
		form.Email.focus();
		return false;
	}
	*/
	
	if (email != "")
	{
		if ((email.length < 3) || (email.length > 50) || 
			(email.charAt(0) == '@') || (email.charAt(email.length-1) == '@') || 
			(email.charAt(0) == '.') || (email.charAt(email.length-1) == '.') || 
			(email.indexOf('.') == -1) || (email.indexOf('@') == -1) ||
			(email.indexOf('@') != email.lastIndexOf('@')) || 
			(email.indexOf(' ') > 0) || (email.indexOf('?') > 0) || (email.indexOf('..') > 0)
			)
		{
			alert("Please, enter correct e-mail address.");
			form.Email.focus();
			return false;
		}
	}
	
	comments = form.Comments.value;
	if (comments == "")
	{
		alert("Please, enter your comments.");
		form.Comments.focus();
		return false;
	}
}

// ***********************************************************************
function checkReferForm(form)
{
	yourname = form.YourName.value;
	if (yourname == "")
	{
		alert("Please, enter your name.");
		form.YourName.focus();
		return false;
	}
	
	friname = form.FriName.value;
	if (friname == "")
	{
		alert("Please, enter your friend name.");
		form.FriName.focus();
		return false;
	}
	
	dayphone = form.DayPhone.value;
	if (dayphone == "")
	{
		alert("Please, enter your friend day phone.");
		form.DayPhone.focus();
		return false;
	}
}
// End hiding script from old browsers -->
