///////////////////////////////////////////////////////////////////////////////
//             Pop-up window function                                       //
//////////////////////////////////////////////////////////////////////////////


function openWin(url, width, height, windowName, ypos, xpos) { 

params = "toolbar=0,";
params += "location=0,";
params += "directories=0,";
params += "status=0,";
params += "menubar=0,";
params += "scrollbars=1,";
params += "resizable=0,"; 

params += "width="+width+",";
params += "height="+height;
if (xpos != null) { params += ",screenX="+xpos; }
if (ypos != null) { params += ",screenY="+ypos; }

win = window.open(url, windowName, params);
win.opener.name = "opener";
win.focus()

}


////////////////////////////////////////////////////////////////////////////
//            image swap - function
////////////////////////////////////////////////////////////////////////////
function imgSwap(img1, img2) {
	if (document.images) {
		var second = eval(img2+".src");
		if (second){
			document.images[img1].src = second;	
		}
	}
}

///////////////////////////////////////////////////////////////////////////////
//             Browser check                                                //
//////////////////////////////////////////////////////////////////////////////

function browserCheck () {
	// convert all characters to lowercase to simplify testing
	var agt			= navigator.userAgent.toLowerCase()
	
	// *** BROWSER VERSION ***
	this.major		= parseInt(navigator.appVersion)
	this.minor		= parseFloat(navigator.appVersion)

	this.ns			= ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1)
						&& (agt.indexOf('compatible') == -1)))
	this.ns2		= (this.ns && (this.major == 2))
	this.ns3		= (this.ns && (this.major == 3))
	this.ns4		= (this.ns && (this.major == 4))
	this.navonly	= (this.nav && (agt.indexOf(";nav") != -1))
	this.dom		= document.getElementById?true:false 
	this.ie			= (agt.indexOf("msie") != -1)
	this.ie3		= (this.ie && (this.major == 2))
	this.ie4		= (this.ie && (this.major == 4) && !(this.dom))
	this.ie5		= (this.ie && (this.major == 4) && this.dom)
	this.ns6		= (!(this.ie) && (this.major == 5) && this.dom)
	
	// 'browser' property should be used to redirect "bad" browsers to a download page or something
	this.browser	= (this.ie4 || this.ie5 || this.ns4 || this.ns6 )

	// *** PLATFORM ***
	this.win		= ((agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1))
	this.win95		= ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1))
	this.win98		= ((agt.indexOf("win98")!=-1)||(agt.indexOf("windows 98")!=-1))
	this.winnt		= ((agt.indexOf("winnt")!=-1)||(agt.indexOf("windows nt")!=-1))
	this.win32		= this.win95 || this.winnt || this.win98 ||
						((this.major >= 4) && (navigator.platform == "Win32")) ||
						(agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1)
	this.mac		= (agt.indexOf("mac")!=-1)
	
	// 'os' property should be used to redirect "bad" browsers to a download page or something
	this.os	= (this.win32 || this.mac)
}

//	intstantiate a new browserCheck object as 'is' global variable
	var is			= new browserCheck()

// ******************************* FIX FOR BROWSER/OS BOOT **************************
if ((!is.browser) || (!is.os)) {
	alert('Your browser and/or OS is not supported')
}

	var vHref		= (is.ns4||is.ns6)?'inc/ns.css':'inc/ie.css'
	var vStyle		= '<link rel="stylesheet" href="'+vHref+'" type="text/css" />'
	document.write(vStyle)
	
