function checkFormSterling(nimo){  
	var valid= false;
	var fieldOK = true;
	var missingFields = "";
	var result = "";
			
	if (nimo.NAME.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Name, ";
		fieldOK = false;
	}
	
	if (nimo.ADDRESS1.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Street Address 1, ";
		fieldOK = false;
	}
	
	if (nimo.CITY.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "City, ";
		fieldOK = false;
	}
		
	if (nimo.ZIP.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Zip Code, ";
		fieldOK = false;
	}
	
	if (nimo.ZIP4.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Zip + 4, ";
		fieldOK = false;
	}
	
	if (nimo.HOMEPHONE.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Home Phone, ";
		fieldOK = false;
	}
	
	if (nimo.WORKPHONE.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Work Phone, ";
		fieldOK = false;
	}
	
	if (nimo.EMAIL.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Email, ";
		fieldOK = false;
	}
	
	if (nimo.SchoolDistrict.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "School District, ";
		fieldOK = false;
	}
	
	if (nimo.COUNTY.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "County, ";
		fieldOK = false;
	}
	
	if (nimo.AccountNumber.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Account Number, ";
		fieldOK = false;
	}
	
	if (nimo.Understand.checked){
		fieldOK = true;
	}
	else {
		missingFields += "You did not check that you understand that a Rep will call to confirm this request; ";
		fieldOK = false;
	}

	if (nimo.Understand2.checked){
		fieldOK = true;
	}
	else {
		missingFields += "You did not check that you understand who to contact for budget billing; ";
		fieldOK = false;
	}

	if (nimo.UnderstandTerms.checked){
		fieldOK = true;
	}
	else {
		missingFields += "You did not check that you understand and agree to the terms and conditions; ";
		fieldOK = false;
	}

	if (missingFields != ""){
		errormsg = "You have not filled in the following fields: ";
		errormsg += missingFields + "\n\n";
		alert(errormsg);
		valid = false;
		}
	else {
		valid = true;
		}
	return valid;
	alert(valid);	
}

function checkFormOther(nimo){  
	var valid= false;
	var fieldOK = true;
	var missingFields = "";
	var result = "";
		
	if (nimo.NAME.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Name, ";
		fieldOK = false;
	}
	
	if (nimo.ADDRESS1.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Street Address 1, ";
		fieldOK = false;
	}
	
	if (nimo.CITY.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "City, ";
		fieldOK = false;
	}
		
	if (nimo.ZIP.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Zip Code, ";
		fieldOK = false;
	}
		
	if (nimo.EMAIL.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Email, ";
		fieldOK = false;
	}
	
	if (missingFields != ""){
		errormsg = "You have not filled in the following fields: ";
		errormsg += missingFields + "\n\n";
		alert(errormsg);
		valid = false;
		}
	else {
		valid = true;
		}
	return valid;
	alert(valid);	
}



function checkForm(nimo){  
	var valid= false;
	var fieldOK = true;
	var missingFields = "";
	var result = "";
		
	if (nimo.SmartRate.checked){
		fieldOK = true;
	}
	else {
		missingFields += "You did not check to be signed up for SmartRate, ";
		fieldOK = false;
	}
	
	
	if (nimo.NAME.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Name, ";
		fieldOK = false;
	}
	
	if (nimo.ADDRESS1.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Street Address 1, ";
		fieldOK = false;
	}
	
	if (nimo.CITY.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "City, ";
		fieldOK = false;
	}
		
	if (nimo.ZIP.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Zip Code, ";
		fieldOK = false;
	}
	
	if (nimo.ZIP4.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Zip + 4, ";
		fieldOK = false;
	}
	
	if (nimo.HOMEPHONE.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Home Phone, ";
		fieldOK = false;
	}
	
	if (nimo.WORKPHONE.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Work Phone, ";
		fieldOK = false;
	}
	
	if (nimo.EMAIL.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Email, ";
		fieldOK = false;
	}
	
	if (nimo.SchoolDistrict.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "School District, ";
		fieldOK = false;
	}
	
	if (nimo.COUNTY.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "County, ";
		fieldOK = false;
	}
	
	if (nimo.AccountNumber.value.length != 0){
		fieldOK = true;
	}
	else {
		missingFields += "Account Number (POD ID), ";
		fieldOK = false;
	}
	
	if (nimo.Understand.checked){
		fieldOK = true;
	}
	else {
		missingFields += "You did not check that you understand that a Rep will call to confirm this request; ";
		fieldOK = false;
	}

	if (nimo.Understand2.checked){
		fieldOK = true;
	}
	else {
		missingFields += "You did not check that you understand who to contact for budget billing; ";
		fieldOK = false;
	}

	if (nimo.UnderstandTerms.checked){
		fieldOK = true;
	}
	else {
		missingFields += "You did not check that you understand and agree to the terms and conditions; ";
		fieldOK = false;
	}

	if (missingFields != ""){
		errormsg = "You have not filled in the following fields: ";
		errormsg += missingFields + "\n\n";
		alert(errormsg);
		valid = false;
		}
	else {
		valid = true;
		}
	return valid;
	alert(valid);	
}


function MM_showHideLayers() { //v6.0
var i,p,v,obj,args=MM_showHideLayers.arguments;
for (i=0; i<(args.length-2); i+=3) 
if ((obj=MM_findObj(args[i]))!=null) 
	{ 
	v=args[i+2];
	if (obj.style) 
		{
		obj=obj.style; 
		v=(v=='show')?'visible':(v=='hide')?'hidden':v; 
		}
	obj.visibility=v; 
	}
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) 
  	selObj.selectedIndex=0;
}

function dropdown(mySel){
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
if(myVal)
   {
   if(mySel.form.target)
   	myWin = parent[mySel.form.target];
   else 
   	myWin = window;
   if (! myWin) 
   	return true;
   myWin.location = myVal;
   }
return false;
}

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}

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_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null)
   {
	document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
   }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

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];
    	}
   }
}

/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

//Contents for About Us Menu
var menu1=new Array()
menu1[0]='<a href="http://www.suburbanpropane.com/aboutus.html">About Us Home</a>'
menu1[1]='<a href="http://www.suburbanpropane.com/mission.html">Mission</a>'
menu1[2]='<a href="http://www.suburbanpropane.com/history.html">History</a>'
menu1[3]='<a href="http://www.suburbanpropane.com/management.html">Management</a>'

//Contents for Investors Menu
var menu2=new Array()
menu2[0]='<a href="http://www.suburbanpropane.com/investors.html">Investors Home</a>'
menu2[1]='<a href="http://www.suburbanpropane.com/pressreleases.html">Press Releases</a>'
menu2[2]='<a href="http://www.suburbanpropane.com/investorfaq.html">Investor FAQ</a>'
menu2[3]='<a href="http://www.suburbanpropane.com/report.html" target="_blank">Annual Report</a>'
menu2[4]='<a href="http://www.suburbanpropane.com/stockprice.html">Stock Quote</a>'
menu2[5]='<a href="http://www.suburbanpropane.com/secfilings.html">SEC Filings</a>'
menu2[6]='<a href="http://www.suburbanpropane.com/section16.html">Section 16 Filings</a>'
menu2[7]='<a href="http://www.suburbanpropane.com/investork1.html">Investor K1s</a>'
menu2[8]='<a href="http://www.suburbanpropane.com/research.html">Research Coverage</a>'
menu2[9]='<a href="http://www.suburbanpropane.com/conduct.html">Code of Conduct</a>'
menu2[10]='<a href="http://www.suburbanpropane.com/ethics.html">Code of Ethics</a>'
menu2[11]='<a href="http://www.suburbanpropane.com/governance.html">Corporate Governance</a>'
menu2[12]='<a href="http://www.suburbanpropane.com/compensation.html">Compensation Committee Charter</a>'
menu2[13]='<a href="http://www.suburbanpropane.com/audit.html">Audit Committee Charter</a>'
menu2[14]='<a href="http://www.suburbanpropane.com/incentive.html">Compensation Recoupment Policy</a>'
menu2[15]='<a href="http://www.suburbanpropane.com/SPH Final VoteTotals.pdf" target="_blank">2009 Tri-Annual Meeting</a>'

//Contents for Propane Menu
var menu3=new Array()
menu3[0]='<a href="http://www.suburbanpropane.com/propane.html">Propane Home</a>'
menu3[1]='<a href="http://www.suburbanpropane.com/residential.html">Residential</a>'
menu3[2]='<a href="http://www.suburbanpropane.com/commercial.html">Commercial</a>'
menu3[3]='<a href="http://www.suburbanpropane.com/agriculture.html">Agriculture</a>'
menu3[4]='<a href="http://www.suburbanpropane.com/construction.html">Construction</a>'
menu3[5]='<a href="http://www.suburbanpropane.com/safety.html">Propane Safety</a>'
menu3[6]='<a href="http://www.suburbanpropane.com/environment.html">Environment</a>'
menu3[7]='<a href="http://www.suburbanpropane.com/consumerFAQ.html">Propane FAQ</a>'
menu3[8]='<a href="http://www.suburbanpropane.com/delivery.html">Delivery Options</a>'
menu3[9]='<a href="http://www.suburbanpropane.com/payment.html">Payment Options</a>'
menu3[10]='<a href="http://www.suburbanpropane.com/readmybill.html">How to Read Your Bill</a>'

//Contents for Heating Oil menu
var menu4=new Array()
menu4[0]='<a href="http://www.suburbanpropane.com/heatingoil.html">Heating Oil Home</a>'
menu4[1]='<a href="http://www.suburbanpropane.com/Oil Consumer Safety Information Carbon Monoxide.pdf" target="_blank">Carbon Monoxide</a>'
menu4[2]='<a href="http://www.suburbanpropane.com/safetyoil.html">Heating Oil Safety</a>'
menu4[3]='<a href="http://www.suburbanpropane.com/deliveryoil.html">Delivery Options</a>'
menu4[4]='<a href="http://www.suburbanpropane.com/payment.html">Payment Options</a>'

//Contents for Natural Gas menu
var menu5=new Array()
menu5[0]='<a href="http://www.suburbanpropane.com/agway.html">AES Home</a>'
menu5[1]='<a href="https://www.suburbanpropane.com/contact_aes.php">Contact AES</a>'
menu5[2]='<a href="http://www.suburbanpropane.com/naturalgascommercial.html">Commercial</a>'
menu5[3]='<a href="http://www.suburbanpropane.com/naturalgasresidential.html">Residential</a>'
menu5[4]='<a href="https://www.suburbanpropane.com/moving.php">Moving</a>'
menu5[5]='<a href="http://www.suburbanpropane.com/naturalgassafety.html">Safety Information</a>'

//Contents for Electricity menu
var menu6=new Array()
menu6[0]='<a href="http://www.suburbanpropane.com/agway.html">AES Home</a>'
menu6[1]='<a href="https://www.suburbanpropane.com/contact_aes.php">Contact AES</a>'
menu6[2]='<a href="http://www.suburbanpropane.com/electricitycommercial.html">Commercial</a>'
menu6[3]='<a href="http://www.suburbanpropane.com/electricityresidential.html">Residential</a>'
menu6[4]='<a href="https://www.suburbanpropane.com/moving.php">Moving</a>'
menu6[5]='<a href="http://www.suburbanpropane.com/electricitysafety.html">Safety Information</a>'

//Contents for Services menu
var menu7=new Array()
menu7[0]='<a href="http://www.suburbanpropane.com/service.html">Service Home</a>'
menu7[1]='<a href="http://www.suburbanpropane.com/serviceplans.html">Service Plans</a>'
menu7[3]='<a href="http://www.suburbanpropane.com/service24.html">24 Hour Service</a>'
menu7[4]='<a href="http://www.suburbanpropane.com/gas_leak.html">Gas Leaks</a>'
menu7[5]='<a href="http://www.suburbanpropane.com/Oil Consumer Safety Information Carbon Monoxide.pdf" target="_blank">Carbon Monoxide</a>'
menu7[6]='<a href="http://www.suburbanpropane.com/equipment_awareness.html">Gas Equipment Awareness</a>'
menu7[7]='<a href="http://www.suburbanpropane.com/Oil Consumer Safety Information.pdf"  target="_blank">Oil Equipment Awareness</a>'
menu7[8]='<a href="http://www.suburbanpropane.com/hhrp.html" target="_blank">HHRP Program</a>'

//Contents for Careers menu
var menu8=new Array()
menu8[0]='<a href="http://www.suburbanpropane.com/careers.html">Careers Home</a>'
menu8[1]='<a href="https://suburbanpropane.tms.hrdepartment.com">Career Opportunities</a>'
menu8[2]='<a href="http://www.suburbanpropane.com/aboutus.html">About Suburban</a>'
menu8[3]='<a href="http://www.suburbanpropane.com/mission.html">Mission & Vision</a>'
menu8[4]='<a href="http://www.suburbanpropane.com/development.html">Career Development</a>'
menu8[5]='<a href="http://www.suburbanpropane.com/benefits.html">Suburban Benefits</a>'
menu8[6]='<a href="http://www.suburbanpropane.com/employees.html">Our Employees</a>'
menu8[7]='<a href="http://www.suburbanpropane.com/employeeexp.html">Employee Experience</a>'
menu8[8]='<a href="http://www.suburbanpropane.com/customerexp.html">Customer Experience</a>'
menu8[9]='<a href="http://www.suburbanpropane.com/goodwill.html">Suburban Goodwill</a>'
menu8[10]='<a href="http://www.suburbanpropane.com/findcenter.html">Store Locator</a>'
menu8[11]='<a href="http://www.suburbanpropane.com/investors.html">Investor Relations</a>'

//Contents for Safety menu
var menu9=new Array()
menu9[0]='<a href="http://www.suburbanpropane.com/safety.html">Propane</a>'
menu9[1]='<a href="http://www.suburbanpropane.com/safetyoil.html">Heating Oil</a>'
menu9[2]='<a href="http://www.suburbanpropane.com/naturalgassafety.html">Natural Gas</a>'
menu9[3]='<a href="http://www.suburbanpropane.com/electricitysafety.html">Electricity</a>'
menu9[4]='<a href="http://www.suburbanpropane.com/gas_leak.html">Gas Leaks</a>'
menu9[5]='<a href="http://www.suburbanpropane.com/Oil Consumer Safety Information Carbon Monoxide.pdf" target="_blank">Carbon Monoxide</a>'
menu9[6]='<a href="http://www.suburbanpropane.com/equipment_awareness.html">Gas Equipment Awareness</a>'
menu9[7]='<a href="http://www.suburbanpropane.com/CSST.pdf" target="_blank">CSST</a>'
menu9[8]='<a href="http://www.suburbanpropane.com/Oil Consumer Safety Information.pdf" target="_blank">Oil Equipment Awareness</a>'
menu9[9]='<a href="http://www.suburbanpropane.com/weather_emergencies.html">Weather Emergencies</a>'
menu9[10]='<a href="http://www.suburbanpropane.com/further_safety.html">Further Safety Info</a>'
		
var menuwidth='100px' //default menu width. Real size supplied by dropdownmenu() call in home page.
var menubgcolor='gray'  //menu bgcolor
var disappeardelay=250  //menu disappear speed onMouseout (in milliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?

/////No further editing needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')

function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}

function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}

function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}

function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)

if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}

return clickreturnvalue()
}

function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}

function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}

function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}

function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}

function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}

if (hidemenu_onclick=="yes")
document.onclick=hidemenu
