//javascript functions


function testFlash(pageURL) {
	//test for flash version
	var player = new MM_FlashInfo();
	var requireFlashVersion = 6;

	if (pageURL) {
		if (player.version >= requireFlashVersion) {
			window.location = pageURL + "?flash=true";
		} else {
			window.location = pageURL + "?flash=false";
		}
	}
}

//write flash area
function writeFlash() {
	//does browser have the proper version of the flash plug-in
	var newHTML = "";

	if (player.version >= requireFlashVersion) {
		newHTML += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="760" height="90" id="navigation" align="">';
		newHTML += '<param name="movie" value="/shared/templates/navigation.swf">';
		newHTML += '<param name="quality" value="high">';
		newHTML += '<param name="bgcolor" value="#ffffff">';
		newHTML += '<param name="FlashVars" value="sectionName=' + sectionName + '&pageName=' + pageName + '">';
		newHTML += '<embed src="/shared/templates/navigation.swf" quality="high" bgcolor="#ffffff" width="760" height="90" name="navigation" align="" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" FlashVars="sectionName=' + sectionName + '&pageName=' + pageName + '"></embed>';
		newHTML += '</object>';
	} else {
		newHTML += '<p>The latest version of the <a href="http://www.macromedia.com/downloads/">Flash plug-in</a> is required.</p>';
	}

	document.write(newHTML);
}


//swap image with a new image URL
function swapImg(imgName, imgURL) {
	imgNum = getImgNum(imgName);

	if (imgNum > -1) {
		document.images[imgNum].src = imgURL;
	}
}

//find image number using older method for compatibility
function getImgNum(imgName) {
	for (i=0; i<document.images.length; i++) {
		if (document.images[i].name == imgName) {return i;}
	}

	return -1;
}

//popup a dialog box to confirm action
function confirmDialogBox(thisTitle, thisAction) {
	confirmWindow = confirm(thisTitle);

	if (confirmWindow == true) {
		if (thisAction) {window.location = thisAction;}
		return true;
	} else {
		return false;
	}
}

//go to the pulldown url
function gotoURL(thisPulldown) {
	if (thisPulldown) {
		window.location = thisPulldown.options[thisPulldown.selectedIndex].value;
		return true;
	} else {
		return false;
	}
}