/* plug-in detection */
function doPluginCheck(pluginName) {	
	var agent = navigator.userAgent.toLowerCase();
	
	if (agent.indexOf('msie') != -1 && agent.indexOf('win') != -1) {
		return true; //IE on Windows will auto download certain plug-ins
	} else if (navigator.plugins) {
		for (var pluginLoop = 0; pluginLoop < navigator.plugins.length; pluginLoop++) {
			var plugin = navigator.plugins[pluginLoop];
			if (plugin.name.indexOf(pluginName) != -1) {
				return true;
			}
		}
		return false;
	} else {
		return true; //browser doesn't have plug-in object - may still support plug-ins
	}
}

/* Function that extracts variables from arguments passed to page */
function parseArgs() {
	var myLocation = location.href

	if (myLocation.indexOf('?') != -1) {
		var myArgString = unescape(myLocation.substring(myLocation.indexOf('?') + 1, myLocation.length))
		if (myArgString.indexOf('&') != -1) {
			var myArgs = myArgString.split('&')
			for (argLoop = 0; argLoop < myArgs.length; argLoop++) {
				eval(myArgs[argLoop])
			}
		}
		else {
			eval(myArgString)
		}
	}
}

/* opens or re-focuses the parent window from the pop-up */
function openParent() {
	if (opener != null) {
		if (!opener.closed) {
			if (opener.top.document.title != "red-mullet.com") {
				opener.top.location = "../index.html"
			}
			opener.focus()
		}
		else {
			opener = null
			openParent()
		}
	}
	else {
		opener = window.open('../home.html', 'opener', 'menubar,resizable,scrollbars,status,toolbar,location')
		while (opener == null) {
			// wait until the opener has opened
		}
		opener.popup = self
	}
}

/* image rollover functions */
function img_act(imgName)
{
	if (document.images) {
		var imgStem = imgName.substr(0, imgName.length - 1)
		document[imgName].src = '../images/' + imgStem + 'on.gif'
	}
}

function img_inact(imgName)
{
	if (document.images) {
		var imgStem = imgName.substr(0, imgName.length - 1)
		document[imgName].src = '../images/' + imgStem + 'of.gif'
	}
}
