 if (document.images) {
	goodVersion = true;
} else {
	goodVersion = false;
}
	
// Begin Browser and DHTML detect	
var BrowserVersion = parseFloat(navigator.appVersion.substring(0, 4));

var BrowserType = "Unknown";
var isMSIE = false;
var isNS = false;
if (navigator.appVersion.indexOf("MSIE") != -1) {
	BrowserType = "MSIE";
	isMSIE = true;
} else if (navigator.userAgent.indexOf("Mozilla", 0) > -1) {
	BrowserType = "NS";
	isNS = true;
}

var OSType = "Unknown";
var isWin = false;
var isMac = false;
if (navigator.userAgent.indexOf("Win", 0) > -1) {
	OSType = "Win";
	isWin = true;
} else if (navigator.userAgent.indexOf("Macintosh", 0) > -1) {
	OSType = "Mac";
	isMac = true;
}
	
var DHTMLversion = "Disabled";
if (BrowserVersion >= 4) {
	if (BrowserType == "MSIE") {
		if (OSType == "Mac") {
			// Disable buggy Mac MSIE DHTML
			DHTMLversion = "Disabled";
		} else {
			DHTMLversion = "MSIE";
		}
	} else if (BrowserType == "NS") {
		if (BrowserVersion >= 6) {
			// Disable buggy NS6 DHTML
			DHTMLversion = "Disabled";
		} else {
			DHTMLversion = "NS";
		}
	}
}
// End Browser and DHTML detect	

function swapImage(imgTag, imgName)
{
	document.images[imgTag].src="images/header/"+imgName;
}


	function swapImageArt(imgTag, imgName)
{
	document.images[imgTag].src="images/header/"+imgName;
}

function popUpWindow(URL, width, height, wname) {
	//alert(wname);
	
	//if (!wname) {
		wname = "PopUpWindow";
	//}
	popwin = window.open(URL, wname, "'toolbar=no,location=no,directories=no,status=no,left=500,menubar=no,scrollbars=no,resizable=no,width=" + width +",height=" + height)
	popwin.opener = self
	popwin.focus()
}

function popUpWindowResize(URL, width, height, name) {
	if (!name) {
		name = "PopUpWindow";
	}
	popwin = window.open(URL, name, "'toolbar=no,location=no,directories=no,status=no,left=500,menubar=no,scrollbars=yes,resizable=yes,width=" + width +",height=" + height)
	popwin.opener = self;
	popwin.focus();
}

function returnSeparateDate(ddMMyyyy,frmName,fldYear,fldMonth,fldDay)
{
	var dd = ddMMyyyy.substring(0,2)
	var mm = ddMMyyyy.substring(2,4)
	var yy = ddMMyyyy.substring(4,8)
	var fldYY = eval("window.opener.document." + frmName + "."+ fldYear)
	var fldMM = eval("window.opener.document." + frmName + "."+ fldMonth)
	var fldDD = eval("window.opener.document." + frmName + "."+ fldDay)
	fldYY.value = parseInt(yy,10)
	fldMM.value = parseInt(mm,10)
	fldDD.value = parseInt(dd,10)
	window.close()
}	

function clearSearch(formField) {
	//  Only clear the field if it is equal to Site Search
	if (formField.value == "Site Search") {
		document.searchForm.searchString.value = "";
	}	
}



function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

function showHide(ID, state) {
	if (DHTMLversion != "Disabled") {
		
		
		if (DHTMLversion.indexOf("NS4", 0) > -1) {
			if (!state) {
				var currentState = document.layers[ID].style.visibility;
			}
			
			if (state == 1 || currentState == "hidden") {
				document.layers[ID].visibility = "show";
			} else {
				document.layers[ID].visibility = "hide";
			}
		} else {
			if (!state) {
				var currentState = document.getElementById(ID).style.visibility
			}
			
			if (state == 1 || currentState == "hidden") {
				document.getElementById(ID).style.visibility = "visible";
				document.getElementById(ID).style.position = "static";

			} else {
				document.getElementById(ID).style.visibility = "hidden";
				document.getElementById(ID).style.position = "absolute";
			}
		}
		//alert("done")
	}
}

function openFAQ(questionID, answerID, arrow, rowCount, thisRow) {
	//show faq answer
	showHide(answerID);
	//close all the other faq's
	for (i=1;i<=rowCount;i++) {
		if (i != thisRow) {
			nextAnswer = 'Answer' + i;
			
			//alert("This popup is temporary,  please ignore:  \nNext Answer: " + nextAnswer);
			var currentState = document.getElementById(nextAnswer).style.visibility;
			
			if (currentState == "visible") {
				showHide(nextAnswer, 0);
			}
		}
	}
}

function changeClass(id, newClass) {
	//alert("This popup is temporary,  please ignore:  \n" + id + "\n" + newClass);
	identity=document.getElementById(id);
	identity.className=newClass;
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		/*  button_about_on = newImage("images/button_about_on.gif");
		button_products_on = newImage("images/button_products_on.gif");
		button_documents_on = newImage("images/button_documents_on.gif");
		button_careers_on = newImage("images/button_careers_on.gif");
		button_contact_on = newImage("images/button_contact_on.gif");
		button_search_on = newImage("images/button_search_on.gif");
		button_hqv_on = newImage("images/button_hqv_on.gif");  */
		preloadFlag = true;
	}
}

preloadImages()