var skipOver;
var whichPulldownBody = 'pulldownBody_product';
var searchable = false;


	// THIS FUNCTION RUNS WHEN YOU SELECT AN ITEM FROM THE PULLDOWN MENU.
	// IT GETS THE CHILD HTML CODE, PARSES IT INTO VALUES, ASSIGNES THOSE
	// VALUES TO THE HIDDEN FORM ELEMENTS (park AND
	// SELECTEDCONDITION) AND UPDATES THE FORM INTERFACE ACCORDINGLY.
	function chooseFromPulldown(fullHtmlString) {
		// we determine whether or not the string is a product or a condition, based upon it's contents
			if (fullHtmlString.indexOf('generic') != -1) {
			// if it is a product, we determine product name, generic name, and legal chars.
				var isProduct = true;
				var isCondition = false;
				var brandProductName = fullHtmlString.split('<')[0]
				// code forking for ie ...
					if (typeof(ActiveXObject) == 'function') {
						var genericProductName = fullHtmlString.split('generic')[1].substring(2, fullHtmlString.split('generic')[1].length - 8);
					} else {
						var genericProductName = fullHtmlString.split('generic')[1].substring(3, fullHtmlString.split('generic')[1].length - 8);
					}
				// code forking for legal marques ...
					if (fullHtmlString.indexOf('<br>') != -1 && fullHtmlString.indexOf('&') != -1) {
						var legalMarque = '&' + fullHtmlString.split('<br>')[0].split('&')[0];
					} else {
						var legalMarque = '';
					}
			} else {
			// if it is a condition, we do not need to parse the string, so our job is easy here.
				var isProduct = false;
				var isCondition = true;
			}
		// now that we have determined product || condition and carried out any necessary parsing, we can set values and update the display
		var maxLength = 40; // maximum characters permitted in field
			if (isProduct) {
				document.getElementById('park').value = brandProductName;
				var stringLength = (brandProductName.length + genericProductName.length + 1);
				// if the string exceeds the maximum characters permitted in the field, we truncate it and add an elipsis...
					if (stringLength > 28) { genericProductName = genericProductName.substring(-1, (genericProductName.length - (stringLength - maxLength))) + '...'; }
				document.getElementById('pulldownHeader').innerHTML = '<span style="color:#993300; font-size:12px;">' + brandProductName + '<span="superScript">' + legalMarque + '</span></span> <span style="color:#000000">(' + genericProductName + ')</span>';
			} else {
				//document.getElementById('park').value = 'false';
				document.getElementById('park').value = fullHtmlString;
				// if the string exceeds the maximum characters permitted in the field, we truncate it and add an elipsis...
					if (fullHtmlString.length > maxLength) {
						fullHtmlString = fullHtmlString.substring(0, maxLength) + '...';
					}
				document.getElementById('pulldownHeader').innerHTML = '<span style="color:#3F3F3F; font-size:11px;">' + fullHtmlString + '</span>';
			}
		document.getElementById(whichPulldownBody).style.display = 'none';
		// this value determines state of the search button
		searchable = true;
	}


	// SHOWS OR HIDES THE MAIN MENU
	function showHide() {
		var checkPullDownBody = document.getElementById(whichPulldownBody).style.display;
		if (checkPullDownBody && checkPullDownBody == 'block') {
			document.getElementById(whichPulldownBody).style.display = 'none';
		} else if (checkPullDownBody && checkPullDownBody == 'none') {
			document.getElementById(whichPulldownBody).style.display = 'block';
		} else {
			document.getElementById(whichPulldownBody).style.display = 'block';
		}
	}


	// THIS SETS THE MENU TIMER THAT HIDES THE ARTIFICIAL FORM SELECT ELEMENTS, IT GETS CALLED ONMOUSEOUT IN A BUNCH OF PLACES.
	// IT GETS CLEARED OUT BY MOST MOUSEOVER EVENTS.
	function killMenuTimer() {
		skipOver = setTimeout("document.getElementById('" + whichPulldownBody + "').style.display = 'none'", 500);
	}


	// MULTI-PURPOSE DIV-SWITCHING FUNCTION
	function contentDivFamilySwitch(divFamily, divToActivate) {
		//// SHOW/HIDE DIVS
		for (var loop = 0; loop < document.getElementsByTagName('div').length; loop++) {
   		var divIdName = eval("document.getElementsByTagName('div')[" + loop + "].id");
			if (divIdName.indexOf(divFamily) == 0) {
				if (divIdName ==  divFamily + divToActivate) {
					document.getElementById(divIdName).style.display = 'block';
				} else {
					document.getElementById(divIdName).style.display = 'none';
				}
			}
		}
	}


	function doNothing() {
		var bootsy = 'collins';
	}