// Custom style sheets - make sure this script is executed AFTER the main stylesheet is written / referenced
if (document.getElementById && !document.all) {
	// Gecko based browser (ie. NS6+ or Mozilla)
	document.write('<link href="/includes/gecko.css" rel="stylesheet" type="text/css">');
}
else if (document.layers) {
	// Netscape 4+ specific
	document.write('<link href="/includes/ns.css" rel="stylesheet" type="text/css">');
}

function Popup(strURL, strName, intWidth, intHeight) {
	if (!strURL) {
		alert('A URL must be specfied when using the Popup function.')
	}
	else {
		if (!strName) { strName = 'popup' }
		if (!intWidth) { intWidth = 600 }
		if (!intHeight) { intHeight = 400 }
		var objWindow = window.open(strURL, strName, 'width=' + intWidth + ',height=' + intHeight + ',scrollbars=yes,resizable=yes,toolbar=no,status=yes');
		objWindow.focus();
	}
}

function Popdown(strURL) {
	if (top.opener) {
		top.opener.location.href = strURL;
		top.opener.focus();
		top.close();
	}
	else {
		alert('Unfortunately the link could not be followed.\nThe window that opened this page may have\nbeen closed, or your browser might not\nsupport this function.')
	}
}

function FieldLength(strLabel, strForm, strField) {
	var intLength = document[strForm][strField].value.length
	alert('The field \'' + strLabel + '\' is ' + intLength + ' characters long.')
}

function CheckAll(strForm, strField) {
	if (document.forms[strForm]) {
		var objForm = document.forms[strForm];
		var blnChecked = objForm[strField].checked;
		var intField, objField;
		for (intField = 0; intField < objForm.elements.length; intField++) {
			objField = objForm.elements[intField];
			if (objField.type == 'checkbox' && objField.name != strField) {
				objField.checked = blnChecked;
			}
		}
	}
}

function CurrencyPopup(QueryString) {
	CurrencyWindow = window.open ('', 'CurrencyWindow', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,height=170,width=600');
	CurrencyWindow.focus();
	CurrencyWindow.location.href = 'http://www.xe.com/pca/input.cgi?' + QueryString;
}

// Flash detection

var MM_contentVersion = 6;
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
if (plugin) {
	var words = navigator.plugins["Shockwave Flash"].description.split(" ");
    for (var i = 0; i < words.length; ++i) {
		if (isNaN(parseInt(words[i]))) continue;
		var MM_PluginVersion = words[i]; 
    }
	var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE") >= 0 && (navigator.appVersion.indexOf("Win") != -1)) {
	document.write('<scr' + 'ipt language="VBScript"\>\n');
	document.write('On Error Resume Next\n');
	document.write('MM_FlashCanPlay = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & MM_contentVersion)))\n');
	document.write('On Error GoTo 0\n');
	document.write('</scr' + 'ipt\>\n');
}

function DisplayNav() {
	if (MM_FlashCanPlay) {
		document.write('<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="420" height="20"><param name="movie" value="/includes/navigation06.swf"><param name="menu" value="false"><param name="quality" value="high"><param name="bgcolor" value="#000066"><embed src="/includes/navigation06.swf" menu="false" quality="high" bgcolor="#000066" width="420" height="20" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"></embed></object>');
	}
	else {
		document.write('<img src="/images/nav_left.gif" width="4" height="20" alt="" border="0"><a href="/"><img src="/images/nav_home.gif" width="32" height="20" alt="home" border="0"></a><img src="/images/nav_mid.gif" width="28" height="20" alt="" border="0"><a href="/games/"><img src="/images/nav_gamedatabase.gif" width="87" height="20" alt="game database" border="0"></a><img src="/images/nav_mid.gif" width="28" height="20" alt="" border="0"><a href="/members/"><img src="/images/nav_myvgr.gif" width="43" height="20" alt="my VGR" border="0"></a><img src="/images/nav_mid.gif" width="28" height="20" alt="" border="0"><a href="/community/"><img src="/images/nav_community.gif" width="64" height="20" alt="community" border="0"></a><img src="/images/nav_mid.gif" width="28" height="20" alt="" border="0"><a href="/forum/"><img src="/images/nav_forums.gif" width="43" height="20" alt="forums" border="0"></a><img src="/images/nav_right.gif" width="28" height="20" alt="" border="0">');
	}
}
