function setBrowser() {
	var navagent = navigator.userAgent.toLowerCase();
	var navname = navigator.appName.toLowerCase();
	var navver = parseInt(navigator.appVersion);
		// get the version in useful form for an opera browser.
	var operaagent = String(navagent.match(/opera[\/| ]\d/));
	operaagent = operaagent.replace(/[\/]/ig, ' ');
	this.op = (operaagent != 'null');

	this.mac = (navagent.indexOf('mac_powerpc') != -1);
	this.win = (navagent.indexOf('windows') != -1);
	this.op = (navagent.indexOf('opera') != -1);
	this.ie = (navagent.indexOf('msie') != -1 && !this.op);
	this.ns = (navname.indexOf('netscape') != -1 && !this.op);
	this.ie4 = (this.ie && navver >= 4);
	this.ns4 = (this.ns && navver == 4);
	this.ns6 = (this.ns && navver == 5);
	this.op5 = (this.op && operaagent == 'opera 5');
	this.op6 = (this.op && operaagent == 'opera 6');
	this.op7 = (this.op && operaagent == 'opera 7');
	this.op6up = (this.op5 || this.op6 || this.op7)
}

var is = new setBrowser();
var pre, suf, sufH, sufF;
if(is.ie4) {
	pre = 'document.all';
	suf = '.style';
	sufH = '';
	sufF = '';
}
if(is.ns4 || is.ns6) {
	pre = 'document'
	suf = '';
	sufH = '.document';
	sufF = '';
}

function fnGetObj(id) {
	if(is.ie4 || is.ns4)
		return eval(pre + "['" + id + "']" + suf);
	if(is.ns6 || is.op6up)
		return document.getElementById(id).style;
}

function fnGetObjHTM(id) {
	if(is.ie4 || is.ns4)
		return eval(pre + "['" + id + "']" + sufH);
	if(is.ns6 || is.op6up)
		return document.getElementById(id)
}

function fnMenu(whichID, whichState){
	if(is.ie4 || is.ns6)
		document.getElementById(whichID).src = "/assets/imgs/" + whichID + whichState;
	if(navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4){
		//
	} else {
		//document.getElementById(whichID).src = "assets/imgs/" + whichID + whichState;
	}
}

function fnSelect(sel){
	if(sel == null || sel == ""){
		//alert("nothing selected")
	} else {
		window.location.href = sel;
	}
}


window.onresize = fnResize
function fnResize(){
	//alert("yaya");
	window.location.reload();
}

function fnPopupWindow(URL, winW, winH, toggle){
	
var windowwidth = winW;
	var windowheight = winH;
	var centerx = screen.width / 2;
	var centery = screen.height / 2;
	var positionx = centerx - (windowwidth / 2);
	var positiony = centery - (windowheight / 2);
	
window.open(URL,"WindowName","scrollbars=" + toggle + ",status=no,resizable=no,copyhistory=no,menubar=no,toolbar=no,location=no,width=" + windowwidth + ",height=" + windowheight + ",left=" + positionx + ",top=" + positiony);

}

// Popup Window Function

	var Popup = {
		open: function(domain, w, h, toggle)
		{
			this.options = {
			url: domain,
			width: w,
			height: h,
			left: screen.width / 2 - (w / 2),
			top: screen.height / 2 - (h / 2),
			scrollbars: toggle
			}
			
			window.open(this.options.url, '', 'resizable=yes, width=' + this.options.width + ',height=' + this.options.height + ',scrollbars=' + this.options.scrollbars + ',left=' + this.options.left + ',top=' + this.options.top);
		}
	}	
	// document.onclick = function() { Popup.open('http://www.storm-media.co.uk/', 780, 440, 'yes'); }