function setLocationCookie(location) {	//alert('setting location: ' + location); 	document.cookie = "location=" + location + ";path=/;";}function getLocationCookie() { var dc = document.cookie;    var prefix = "location=";   // alert('prefix: ' + prefix);    var begin = dc.indexOf("; " + prefix);    if (begin == -1)    {        begin = dc.indexOf(prefix);        if (begin != 0) return null;	}    else    {        begin += 2;    }    var end = document.cookie.indexOf(";", begin);    if (end == -1)    {        end = dc.length;    }    return unescape(dc.substring(begin + prefix.length, end));  }  function showCollectionServices() {	if ((getLocationCookie() == null) || (getLocationCookie() == "") || (getLocationCookie() == "none")) {	 	//alert ("going to default collection services page");	  	window.location="http://www.edcodisposal.com/services/index.html" 	} 	else { 		window.location="http://www.edcodisposal.com/services/" + getLocationCookie() + "/index.html" 	} 	/* 	else if (getLocationCookie() == "losangeles") { 		//alert ("going to los angeles collection services page"); 	  	window.location="http://www.edcodisposal.com/services/losangeles/index.html" 	} 	else if (getLocationCookie() == "carson") { 		//alert ("going to carson collection services page"); 	 	window.location="http://www.edcodisposal.com/services/carson/index.html" 	} else { 		window.location="http://www.edcodisposal.com/services/index.html" 	} 	*/ }function showContactInfo() {	if ((getLocationCookie() == null) || (getLocationCookie() == "") || (getLocationCookie() == "none")) {	 	//alert ("going to default collection services page");	  	window.location="http://www.edcodisposal.com/contact/index.html" 	} 	else { 		window.location="http://www.edcodisposal.com/services/" + getLocationCookie() + "/contact.html" 	} 	/* 	else if (getLocationCookie() == "losangeles") { 		//alert ("going to los angeles collection services page"); 	  	window.location="http://www.edcodisposal.com/services/losangeles/index.html" 	} 	else if (getLocationCookie() == "carson") { 		//alert ("going to carson collection services page"); 	 	window.location="http://www.edcodisposal.com/services/carson/index.html" 	} else { 		window.location="http://www.edcodisposal.com/services/index.html" 	} 	*/ } function showMiniSiteHome(locationName) { 	setLocationCookie(locationName); 	window.location="http://www.edcodisposal.com/services/" + locationName + "/index.html"; } function resetLocation() { 	document.cookie = "location=none;path=/;"; // set location to none 	showCollectionServices(); // go to Collection Services default page 	}  function runServices() {    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" height="275" width="325">\n');    document.write('<param name="movie" value="services.swf">\n');    document.write('<param name="quality" value="best">\n');    document.write('<param name="play" value="true">\n');    document.write('<embed pluginspage="http://www.macromedia.com/go/getflashplayer" src="services.swf" type="application/x-shockwave-flash" width="287" height="243" quality="best" play="true">\n');    document.write('</object>\n');    }function verifyFormMiniSite() {var verificationAlerts = "";	hideVerificationAlertsMessage();	document.getElementById('verificationAlertsMessage').innerHTML = " "; // clear any old verification alerts	var theForm = document.forms[0];	var requiredFields = new Array(theForm.email);	var requiredFieldsUserPresentableNameList = new Array("Email Address");	var namesOfBlankFields = new Array();		// add user presentable name to items in required fields array	for (var i=0;i<requiredFields.length;i++) {		// assign user presentable name to required fields		requiredFields[i].userPresentableName = requiredFieldsUserPresentableNameList[i];		if (requiredFields[i].value == "") {			// collect user presentable names of any blank required fields in array			namesOfBlankFields.push(requiredFields[i].userPresentableName);		}	}	// if blanks required fields found warn user	if (namesOfBlankFields.length > 0) {		verificationAlerts = "<h2>Please enter missing details and submit your request again.</h2><ul>";		for (var x=0;x<namesOfBlankFields.length;x++) {			verificationAlerts = verificationAlerts + "<li>" + namesOfBlankFields[x] + "</li>" ;		}		verificationAlerts = verificationAlerts + "</ul>"		document.getElementById('verificationAlertsMessage').innerHTML = verificationAlerts;		showVerificationAlertsMessage();		return false;	}	var emailField = document.getElementsByName('email')[0];	if ((emailField.value.indexOf('@') < 0) || (emailField.value.indexOf('.') < 0)) {		verificationAlerts = "<h2>Please enter a valid email address.</h2><ul>";		document.getElementById('verificationAlertsMessage').innerHTML = verificationAlerts;		showVerificationAlertsMessage();		return false;		}		// if data entered correctly, submit form	theForm.submit();	}function hideVerificationAlertsMessage () {	document.getElementById('verificationAlertsMessage').style.visibility = 'hidden';}function showVerificationAlertsMessage () {	document.getElementById('verificationAlertsMessage').style.visibility = 'visible';} 
