/*
	file: stylesheet.js
	action: loads a specific .css stylesheet file
	author: nicolas glinoer - n@walkingmen.com
	copyright: SWIFT scrl
	date: 03 10 22
*/


//Detection syntax for stylesheet.
var A=navigator.userAgent
function caps(){
	var t=true, p="", v="";
	p=A.indexOf("MSIE");
	if (p!=-1){
    	this.ie=true;
		v=A.charAt(p+5);
		(v==2)?this.ie2=true:this.ie2=false;
		(v==3)?this.ie3=true:this.ie3=false;
		(v==4)?this.ie4=true:this.ie4=false;
		(v==5)?this.ie5=true:this.ie5=false;
		(v==6)?this.ie6=true:this.ie6=false;
	} else {
		this.ie=false;
		this.ie2=false;
		this.ie3=false;
		this.ie4=false;
		this.ie5=false;
		this.ie6=false;
	}
	(this.ie4||this.ie5||this.ie6)?this.IE4RelOrNewer=true:this.IE4RelOrNewer=false;
	(A.indexOf("Mozilla") !=-1 && A.indexOf("compatible")==-1)?this.nav=true:this.nav=false;
	(A.indexOf("Mozilla/5") !=-1)?this.nav6=true:this.nav6=false;
	(A.indexOf("Windows 95")>0||A.indexOf("Win95")!=-1||A.indexOf("Win98")!=-1||A.indexOf("Windows 98")!=-1||A.indexOf("Windows NT")!=-1)?this.win32=true:this.win32=false;
	(A.indexOf("Windows 3.1")!=-1||A.indexOf("Win16")!=-1)?this.win16=true:this.win16=false;
	(A.indexOf("Mac")!=-1)?this.anymac=true:this.anymac=false;
}

//Get stylesheet based on detection syntax.
function GetCSS(){
	var u="";
	if(bc.anymac  && bc.ie4){u="pc_ns"}   //Mac IE4+   stylepc_ns.css
	else if(bc.anymac  && bc.ie){u="pc_ie"}   //Mac IE5+   stylepc_ie.css
	else if(bc.anymac  && !bc.ie && bc.nav6){u="pc_ie"}  //Mac NS6   stylepc_ie.css
	else if(bc.anymac  && !bc.ie){u="pc_ns"}  //Mac NS   stylepc_ns.css
	else if (bc.IE4RelOrNewer && !bc.anymac){u="pc_ie"}  //PC with Ms IE4+   stylepc_ie.css
	else if (bc.ie3 && !bc.anymac){u="pc_ie"}  //PC with Ms IE3   stylepc_ie.css
	else if (bc.nav6 && !bc.anymac){u="pc_ie"}  //PC with NS6   stylepc_ie.css
	else if (bc.nav && !bc.anymac){u="pc_ns"}  //PC with NS   stylepc_ns.css
	else {u="pc_ie"} //probably Opera
	document.write ("<link HREF=/biconline/extras/style" + u + ".css REL=StyleSheet>");  // ou se trouve le css, dans quel dossier
}


var bc=new caps();
GetCSS();

var isNetscape4PC = false;
if (bc.nav && !bc.anymac && !bc.nav6) {
isNetscape4PC = true;
}
