// DIV functionsfunction performJump (destUrl){	// if the url begins with 'www', 'http://', or 'https://' we need to open a popUp window	if ((destUrl.indexOf("www") == 0) || (destUrl.indexOf("http://") == 0) || (destUrl.indexOf("https://") == 0)) {		// if the url begins with www, we need to add 'http://' to the beginning		if (destUrl.indexOf("www") == 0) {			destUrl = "http://" + destUrl;		}		// check if the url contains the current hostname		if (destUrl.indexOf(location.hostname) != -1) {			// contains hostname, don't open a popup			if (name == "topContent") {				parent.location.href = destUrl;			} else {				location.href = destUrl;			}		} else {			if (!window.popupWindow) {				// window hasn't been defined				popupWindow = window.open(destUrl,"","width=600,height=450,left=100,top=75,screenX=100,screenY=75,scrollbars,location,menubar,status,toolbar,resizable=1");			} else {				// window has been defined				if (!popupWindow.closed) {					// still open					popupWindow.focus();					popupWindow.location.href = destUrl;				} else {					popupWindow = window.open(destUrl,"","width=600,height=450,left=100,top=75,screenX=100,screenY=75,scrollbars,location,menubar,status,toolbar,resizable=1");				}			}		}	} else if (destUrl.charAt(0) == "/") {		if (name == "topContent") {			parent.location.href = destUrl;		} else {			location.href = destUrl;		}	} else if (destUrl.indexOf(".cat.com") != -1) {		window.location.href = destUrl;	} else if (destUrl.charAt(0) == "#") {		window.location.href = destUrl;	} else {		if (destUrl.indexOf("://") == -1) {			destUrl = 'http://' + destUrl;		}		if (!window.popupWindow) {			// window hasn't been defined			popupWindow = window.open(destUrl,"","width=600,height=450,left=100,top=75,screenX=100,screenY=75,scrollbars,location,menubar,status,toolbar,resizable=1");		} else {			// window has been defined			if (!popupWindow.closed) {				// still open				popupWindow.focus();				popupWindow.location.href = destUrl;			} else {				popupWindow = window.open(destUrl,"","width=600,height=450,left=100,top=75,screenX=100,screenY=75,scrollbars,location,menubar,status,toolbar,resizable=1");			}		}	}}function getSelectedValue(selectBox) {	var selValue;	var selIndex = selectBox.selectedIndex;	if(selIndex != -1) {		selValue = selectBox.options[selIndex].value;	}	if (selValue != "") {		performJump(selValue);	}}function unloadBody() {	if (window.popupWindow) {		popupWindow.close();	}}function changeLanguage() {    // alter the action and submit the form    document.dsf.action = "/dsf/language";    document.dsf.submit();}if (self == top) {	if (self.name != "dsfFrame") {		self.name = "dsfFrame";	}} else {	if (self.name == "topContent") {		// on the application page self.name = topContent, parent.name = dsfFrame		if (parent.name != "dsfFrame") {			parent.name = "dsfFrame";		}	} else {		// framed by outside application		if (self.name != "dsfFrame" && self.name != "main_category") {			self.name = "dsfFrame";		}	}}_uacct = "UA-508343-4";urchinTracker();function ValidateSurvey(aForm){	if (IsFieldEmpty(aForm.Q5303)){       alert('Email Address has not been answered.');		window.location="http://www.zieglercat.com/compact/default.cfm?PID=1.15.1#Q1";		return false;	}	if (IsFieldEmpty(aForm.Q5304)){       alert('First Name has not been answered.');		window.location="http://www.zieglercat.com/compact/default.cfm?PID=1.15.1#Q2";		return false;	}	if (IsFieldEmpty(aForm.Q5305)){       alert('Last Name has not been answered.');		window.location="http://www.zieglercat.com/compact/default.cfm?PID=1.15.1#Q3";		return false;	}	if (IsFieldEmpty(aForm.Q5306)){       alert('Company Name has not been answered.');		window.location="http://www.zieglercat.com/compact/default.cfm?PID=1.15.1#Q4";		return false;	}	if (aForm.Q5307.selectedIndex == 0){       alert('Primary Industry must have at least one option selected.');		window.location="http://www.zieglercat.com/compact/default.cfm?PID=1.15.1#Q5";		return false;	}	if (IsFieldEmpty(aForm.Q5308)){       alert('Zip Code has not been answered.');		window.location="http://www.zieglercat.com/compact/default.cfm?PID=1.15.1#Q6";		return false;	}return true;}function flipshow(column,linkID){		//this value can be fixed based on the max no.of specs returned for the given model		leng = 150;		if (column==0)			otherColumn=1;		else 			otherColumn=0;		for (i = 0; i < leng; i++) {						theId = "column_" + column + "_" + i;			theOtherId = "column_" + otherColumn + "_" + i;						show(theId);			hide(theOtherId);		}		otherLinkID="none";		if (linkID=="metricLink") otherLinkID="usLink";		if (linkID=="usLink") otherLinkID="metricLink";		link1=document.getElementById(linkID);		link2=document.getElementById(otherLinkID);				toggleLink(link1,link2);	}			function flip(column,linkID){		leng = 50;		if (column==1){			column2=2;			column3=3;			otherColumn=4;			otherColumn2=5;			otherColumn3=6;		}		else {			column=4;			column2=5;			column3=6;			otherColumn=1;			otherColumn2=2;			otherColumn3=3;		}		for (i = 0; i < leng; i++) {			theId = "column_" + column + "_" + i;			theId2 = "column_" + column2 + "_" + i;			theId3 = "column_" + column3 + "_" + i;			theOtherId = "column_" + otherColumn + "_" + i;			theOtherId2 = "column_" + otherColumn2 + "_" + i;			theOtherId3 = "column_" + otherColumn3 + "_" + i;			show(theId);			show(theId2);			show(theId3);			hide(theOtherId);			hide(theOtherId2);			hide(theOtherId3);		}		otherLinkID="none";		if (linkID=="metricLink") {			otherLinkID="usLink";		}		if (linkID=="usLink") {			otherLinkID="metricLink";		}				link1=document.getElementById(linkID);		link2=document.getElementById(otherLinkID);		toggleLink(link1,link2);	}	function hide(theId){		if (document.getElementById(theId)!=null)			document.getElementById(theId).style.display = 'none'; 	}	function show(theId){		if (document.getElementById(theId)!=null)			document.getElementById(theId).style.display = '';	}	function toggleLink (link1,link2) {		//enableLink (link2)		link2.disabled = false;		link1.disabled = true;	}	function enableLink (link) {;  		link.onclick = link.oldOnClick ? link.oldOnClick : null;		if(link.style)    		link.style.cursor = document.all ? 'hand' : 'pointer';	}		function openPopupPrint(url,param,action) {		window.open('http://imagetrend.com/CMSZiegler/@resource/CATProducts/printFriendly.cfm?pid=1.10.1&menu=17204'+param, "win",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=650,height=600');	}	function WipeZip(formobject)		{			$('zip2check').value="";		}	function WipeCity(formobject)		{			$('city2check').value="";		}	function validateF(formobject){		//alert($('zip2check').value.length);		// Validate 34 for country		if ($('ProdList').value == ''){			alert("Please select a search option.")			return (false);		}		if ($('ProdList').value != 10){			//clears the zipcode and county			$('zip2check2').value = "";			$('county2check').value = "";						if($('zip2check').value.length == 0 && $('city2check').value.length == 0){				alert ("Please enter either a zipcode or city and state.");				return false;			}		} else {						//clears the zipcode and city			$('zip2check').value = "";			$('city2check').value = "";						if($('zip2check2').value.length == 0 || $('county2check').value.length == 0){				alert ("Please enter both a zipcode and a county.");				return false;			}		}		if ($('ProdList').value == 34) {			if ($('powerList').value == 0) {				alert("Please select the type of power.");				return false;			}		}		if ($('ProdList').value == 10) {			if ($('AgricultureList').value == 0) {				alert("Please select the type of equipment.");				return false;			}		}	}	function showSubCategories(idValue) {		// 34 is Power systems Sales specialist.		if ($('ProdList').value == 34)			{				Element.show('PowerSystem');				Element.hide('Agriculture');			}		else			{				Element.hide('PowerSystem');				$('powerList').value=("0");			}	}	function showSubCategories1(idValue)	{		// 10 is Agriculture Sales Specialist.		if ($('ProdList').value == 10)			{				Element.show('Agriculture');				Element.hide('PowerSystem');			}		else			{				Element.hide('Agriculture');				$('AgricultureList').value=("0");			}	}	function showCounty(idValue) {		// 10 is Agriculture Equip.		if ($('ProdList').value == 10)			{			//if ($('ProdList_' + idValue).checked == true){				//Element.show('CountyDiv1');				Element.show('CountyDiv2');				Element.show('CountyDiv3');				//Element.hide('StateDiv1');				Element.hide('StateDiv2');				Element.hide('StateDiv3');			}		else			{				//Element.show('CountyDiv1');				Element.hide('CountyDiv2');				Element.hide('CountyDiv3');				//Element.show('StateDiv1');				Element.show('StateDiv2');				Element.show('StateDiv3');			}	}		function SendQuery(key) {		Initialize();			if(req!=null) {			req.onreadystatechange = Process;			req.open("GET", 'http://www.zieglercat.com/compact/@Resource/dealerlocator/getCounties.cfm?SearchValue='+key, true); 	        req.send(null);		}	}	/*	function SelectItem(SearchValue, IDValue) {		$('username').value = SearchValue;		$('user').value = IDValue;		//document.browsePolicies.submit();		HideDiv('autocomplete');	}	*/	function SelectItem(SearchValue) {		$('county2check').value = SearchValue;		//$('user').value = IDValue;		//document.browsePolicies.submit();		HideDiv('autocomplete');	}		function change(id, newClass) {		identity = $(id);		identity.className = newClass;	}		function resetbox() {		j = 0;		setTimeout("HideDiv('autocomplete');", 500)	}		function changestate(e) { 		if(window.event) {			// for IE, e.keyCode or window.event.keyCode can be used			charCode = e.keyCode; 		}		else if(e.which) {			// netscape			charCode = e.which; 		}		else {			// no event, so pass through			return true;		}		//var charCode = event.keyCode;		if (charCode == 40) { 			//On Down Arrow key up			//alert(event.keyCode);			if (j != 0) {				//If Not First Record				var h = 'row' + j;				var z = 'row' + (j + 1);								if ($(z) != null) {					//If not last record					change(h,'selectedrow');//Deselect previous selection					j = j + 1;				}			}			else {				//if first record increment j				j = j + 1;			}						//increment value of current selection			var h = 'row' + j;						if ($(h) != null) {				//Check for last record				change(h,'selected');//Set current record active				//sets the value of the search field to the name of the link				$('county2check').value = $(h).name;				//$('user').value = $(h).title;			}		}		else if (charCode == 38) { 			//On Up Arrow key up				if (j != 0)	{				var h = 'row' + j;					change(h,'selectedrow');				j = j - 1;				var h = 'row' + j;									if ($(h) != null) {					change(h,'selected');					$('county2check').value = $(h).name;					//$('user').value = $(h).title;				}			}		}		else if ((charCode == 8) || (charCode == 37) || (charCode == 46)) {			// If user clicks back arrow, or delete, reset counter.			j = 0;			SendQuery($('county2check').value);		}					else {			SendQuery($('county2check').value);			//return true;			}	}
