//javascript functions


//test for flash or no flash and reload current page
function testFlash(pageURL) {
	//test for flash version

	if (pageURL) {
		var player = new MM_FlashInfo();
		var requireFlashVersion = 7;

		if (player.version >= requireFlashVersion) {
			window.location = pageURL + "?flash=true";
		} else {
			window.location = pageURL + "?flash=false";
		}
	}
}

//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;
}

//go to the pulldown url
function gotoURL(thisPulldown) {
	if (thisPulldown) {
		window.location = thisPulldown.options[thisPulldown.selectedIndex].value;
		return true;
	} else {
		return false;
	}
}

//open popup window
function openWindow(url, name, width, height) {
	if (!url) {return false;}

	if (!name) {name = "popupwin";}
	if (!width) {width = 550;}
	if (!height) {height = 600;}

	properties = 'toolbar=0';
	properties += ', scrollbars=1';
	properties += ', location=0';
	properties += ', statusbar=0';
	properties += ', menubar=0';
	properties += ', resizable=1';
	properties += ', width=' + width;
	properties += ', height=' + height;
	properties += ', left=50';
	properties += ', top=50';

	window.open(url, name, properties);
}