// browser detect

function BrowserCheck() {
	var bAgent = navigator.userAgent;
	var b = navigator.appName;
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b;
	this.v = parseInt(navigator.appVersion);
	this.ns = (this.b=="ns" && this.v>=4);
	this.ns4 = (this.b=="ns" && this.v==4);
	this.ns5 = (this.b=="ns" && this.v==5);
	this.ns6 = (this.b=="ns" && navigator.userAgent.indexOf('Netscape6')>0);
	this.ie = (this.b=="ie" && this.v>=4 && !navigator.userAgent.indexOf('Mac'));
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0 && !navigator.userAgent.indexOf('Mac'));
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0);
	this.ie7 = (navigator.userAgent.indexOf('MSIE 7')>0);
	if (this.ie5) this.v = 5;
	this.min = (this.ns||this.ie);
	this.ie45Mac = (navigator.userAgent.indexOf('MSIE 4')>0 && navigator.userAgent.indexOf('Mac')>=0);
	this.ie5Mac = (navigator.userAgent.indexOf('MSIE 5')>0 && navigator.userAgent.indexOf('Mac')>=0);

	this.Moz = (bAgent.indexOf("Gecko") != -1);
	this.SAFARI = (bAgent.indexOf("Safari",0) != -1);
	this.ICAB = (bAgent.indexOf("iCab",0) != -1);
	this.OPERA = (bAgent.indexOf("Opera",0) != -1);
	this.FIREFOX = (bAgent.indexOf("Firefox",0) != -1);
}

// automatically create the "is" object
is = new BrowserCheck();


// detect platform and write in appropriate style sheet

function platform() {
	this.v = parseFloat(navigator.appVersion);
	this.uA = navigator.userAgent;
	this.mac = false;
	this.pc = false;

	navigator.appVersion.indexOf('Mac') != -1?(this.mac = true):(this.pc = true);
}

plat = new platform();

platform.prototype.EmbedStyleSheet=DetectEmbedStyleSheet;

function DetectEmbedStyleSheet(file,elsefile){
	var args = DetectEmbedStyleSheet.arguments;
	var conditions = 0;
	var embed_file;
	
	for(i = 2;i < args.length;i++) {
			if(args[i] == true) {
			conditions++;
	}
}
if(conditions == (args.length-2) || args.length <= 2){
	embed_file = file;
}
else if(elsefile) {
	embed_file = elsefile;
}
if(embed_file) {
	document.writeln('<LINK REL="stylesheet" TYPE="text/css" HREF="'+embed_file+'">');
	}
}

// hack for css prob

cssTemp = "";

if (is.ns && plat.pc) {
cssTemp = "<br>"; 
} else {
cssTemp = "<span class=negative_zzz>&nbsp;<br></span>";
}

// popup window

function remWin(url,name,parms) {

     var remote = window.open(url,name,parms);
     if (!remote.opener) 
			remote.opener = self;
	 if (window.focus)
     		remote.focus();	 
}


