var domType    = "NS";
var oldBrowser = false;

if (navigator.userAgent.indexOf("MSIE") != -1)        browser = "MSIE";
if (navigator.userAgent.indexOf("Netscape") != -1)    browser = "Netscape";
if (navigator.userAgent.indexOf("Firefox") != -1)     browser = "Firefox";
if (navigator.userAgent.indexOf("Safari") != -1)      browser = "Safari";
if (navigator.userAgent.indexOf("Opera") != -1)       browser = "Opera";
if (navigator.userAgent.indexOf("Camino") != -1)      browser = "Camino";
if (navigator.userAgent.indexOf("Mozilla/4.7") != -1) version = "4.7";
if (navigator.userAgent.indexOf("Mac") != -1)  		  os = "Mac";

if (browser == "MSIE") domType = "IE";
	
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

$(document).ready(function() {
	
	var body_height = $('body').outerHeight();
	var content_height = $('#container').outerHeight();
	
	if (body_height > content_height) {
		$('#container').css('height',body_height+'px');
	}
	
});

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function rollover(name, state)
{
	document.images[name].src = "/images/menu_" + name + "_" + state + ".gif";
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function popup(winName, width, height)
{
	if (browser == "Netscape") {
		width += 75;
		height += 75;
	}
	else {
		width += 60;
		height += 60;
	}
	
	win = window.open("",winName,"location=yes,status=no,scrollbars=yes,width=" + width + ",height=" + height);
	
	win.focus();
	
	return win;
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function popup2(winName, width, height)
{
	win = window.open("",winName,"status=no,scrollbars=no,width=" + width + ",height=" + height);
	
	win.focus();
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function popup3(winName, width, height)
{
	if (browser == "Netscape") {
		width += 75;
		height += 75;
	}
	else {
		width += 60;
		height += 60;
	}
	
	win = window.open("",winName,"location=no,status=no,scrollbars=yes,width=" + width + ",height=" + height);
	
	win.focus();
	
	return win;
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function popup4(url,winName, width, height)
{
	win = window.open(url,winName,"status=no,scrollbars=yes,width=" + width + ",height=" + height);
	
	win.focus();
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function border(targetID,color) 
{	
	if (color == 'out') 
		color = '#999999';
	else
		color = '#FDA203';
		
	document.getElementById(targetID).style.border = "1px solid " + color;
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function flipthrough(id_part,id_num) {
	
	if (document.getElementById) {
	
		num = 1;
		
		while (document.getElementById(id_part+num))
		{
			document.getElementById(id_part+num).style.display = "none";
			num = num + 1;
		}
		
		document.getElementById(id_part+id_num).style.display = "block";
		
		document.location.hash = "image"+id_num;
	}
}

// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

function getQueryVariable(variable) {

	var query = window.location.search.substring(1);
	var vars = query.split("&");

	for (var i=0;i<vars.length;i++) {
		var pair = vars[i].split("=");
		if (pair[0] == variable) {
			return pair[1];
		}
	}
}
