var agent=navigator.userAgent;
var isOpera=agent.indexOf("Opera")>-1;
var isIE=agent.indexOf("MSIE")>-1&&!isOpera;
var isMozilla=agent.indexOf("Mozilla")>-1&&!isOpera&&!isIE;
var isSafari=agent.indexOf("Safari")>-1;
var Browser=1*isIE+2*isOpera+3*isMozilla+4*isSafari;
var IE=1,Opera=2,Mozilla=3;Safari=4;

function navShow() {
	var arrayLayers = document.getElementsByTagName("div");
	var i; var j;
	for (i = 0; i < arrayLayers.length; i++) {
		if (arrayLayers[i].id.substr(0,8) == "rolldown") {
			arrayLayers[i].style.display = "none";
		}
	}

	for (j = 0; j < arguments.length; j++) {
		document.getElementById(arguments[j]).style.display = "block";
	}
}

function flash(strFile, strId, intWidth, intHeight) {
	document.write("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" name=\"" + strId + "\" width=\"" + intWidth + "\" height=\"" + intHeight + "\" id=\"" + strId + "\">");
    document.write("<param name=\"movie\" value=\"" + strFile + "\" />");
    document.write("<param name=\"quality\" value=\"high\" />");
	document.write("<param name=\"wmode\" value=\"transparent\">");
	document.write("<param name=\"SCALE\" value=\"noborder\">");
	document.write("<param name=\"menu\" value=\"false\">");
	document.write("<embed src=\"" + strFile + "\" width=\"" + intWidth + "\" height=\"" + intHeight + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" wmode=\"transparent\" scale=\"noborder\" menu=\"false\" name=\"" + strId + "\"></embed></object>");
}

function navHighlight(id) {
	id.style.backgroundColor = "#D7D7CF";
	//id.style.color = "white";
}

function navRestore(id) {
	id.style.backgroundColor = "";
	id.style.color = "";
}

function getURL() {
	window.location = arguments[0];
}

function formVerify() {
	
	boolAlert = false;
	for (intLoop = 1; intLoop < arguments.length; intLoop++) {
		boolEmpty = false;
		switch(document.getElementsByName(arguments[intLoop])[0].type) {
		
			case "checkbox":
				if (document.getElementsByName(arguments[intLoop])[0].checked != true) { boolEmpty = true; }
				break;		
		
			case "radio":
				boolEmpty = true;
				for (intSubLoop = 0; intSubLoop < document.getElementsByName(arguments[intLoop]).length; intSubLoop++) {
					if (document.getElementsByName(arguments[intLoop])[intSubLoop].checked == true) { boolEmpty = false; }
				}
				break;

			case "select-one":
				if (document.getElementsByName(arguments[intLoop])[0].selectedIndex == 0) { boolEmpty = true; }
				break;		

			default:
				if (document.getElementsByName(arguments[intLoop])[0].value.replace(/ /g, "").length == 0) { boolEmpty = true; }
				break;		
		
		}

		if (boolEmpty == true) { boolAlert = true; }

	}

	if (boolAlert == true) { 
		alert(arguments[0]);
		return false;
	} else {
		return true;
	}
}

function changeSrc() {

	objTarget = document.getElementById(arguments[0]);
	strUrl = "image.asp?image=" + arguments[1];

	objTarget.src = strUrl;

}