﻿//---------------------------------------------------------------------------------------------------
function show(showid){
	var browser=navigator.appName;
	if (browser=="Netscape"){
		document.getElementById(showid).style.display = "table-row";
		document.getElementById(showid).style.width = "100%";
		}
	if (browser=="Microsoft Internet Explorer") {
		document.getElementById(showid).style.display = "inline";
		}
	} 
//---------------------------------------------------------------------------------------------------
function hide(hideid){
	document.getElementById(hideid).style.display = "none";
	}
//---------------------------------------------------------------------------------------------------
	
	
//---------------------------------------------------------------------------------------------------
// Provide a set of functions for FireFox since MSIE is a pathetic excuse for a 
// standards based browser (which it is not)
//---------------------------------------------------------------------------------------------------

function ff_show(showid){
 	document.getElementById(showid).style.display = "table-row";
	} 
//---------------------------------------------------------------------------------------------------
function ff_hide(hideid){
 	document.getElementById(hideid).style.display = "none";
	}
//---------------------------------------------------------------------------------------------------
function getValue(varname){
	// First, we load the URL into a variable
	var url = window.location.href;
	
	// Next, split the url by the ?
	var qparts = url.split("?");
	
	// Check that there is a querystring, return "" if not
	if (qparts.length == 0) {
		return "";
		}
	
	// Then find the querystring, everything after the ?
	var query = qparts[1];
	
	// Split the query string into variables (separates by &s)
	var vars = query.split("&");
	
	// Initialize the value with "" as default
	var value = "";
	
	// Iterate through vars, checking each one for varname
	for (i=0;i<vars.length;i++) {
		// Split the variable by =, which splits name and value
		var parts = vars[i].split("=");
		
		// Check if the correct variable
		if (parts[0] == varname){
			// Load value into variable
			value = parts[1];
			// End the loop
			break;
		}
	}

	// Convert escape code
	value = unescape(value);
	// Convert "+"s to " "s
	value.replace(/\+/g," ");
	// Return the value

	return value;
}
function openWindow(url) {
	var w = 480;
	var h = 340;
	
	if (document.all || document.layers){
		w = screen.availWidth;
		h = screen.availHeight;
	}
	
	var popW = 726, popH = 424;
	var leftPos = (w-popW)/2, topPos = (h-popH)/2;
	
	popupWin = window.open(url,'Name', 'top='+ topPos +',left=' + leftPos + ',resizable=no,width=726,height=424,scrollbars=yes,menubar=no')
}
//---------------------------------------------------------------------------------------------------