//Detailed Browser Sniff
function Is() {
	var agent = navigator.userAgent.toLowerCase();
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);
	this.ns = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)));
	this.ns2 = (this.ns && (this.major == 3));
	this.ns3 = (this.ns && (this.major == 3));
	this.ns4b = (this.ns && (this.minor < 4.04));
	this.ns4 = (this.ns && (this.major == 4));
	this.ns5 = (this.ns && (this.major >= 5));
	this.ie = (agent.indexOf("msie") != -1);
	this.ie3 = (this.ie && (this.major == 2));
	this.ie4 = (this.ie && (this.major >= 4));
	this.op3 = (agent.indexOf("opera") != -1);
	this.win = (agent.indexOf("win")!=-1);
	this.mac = (agent.indexOf("mac")!=-1);
	this.unix = (agent.indexOf("x11")!=-1);
	this.ns6 = false;
	if (navigator.userAgent.indexOf("Netscape6") > 0) {	
		this.ns6 = true;
        Netscape6_start = (navigator.userAgent.indexOf("Netscape6") + 10);
        Netscape6_end = navigator.userAgent.length;
        this.ns6version = parseFloat(navigator.userAgent.substring(Netscape6_start,Netscape6_end));
        if (this.ns6version == 6.1){
			this.ns5 = false;
			this.ns4 = true;
		}
        
	}

	//alert(this.major);
	//dbg
	//alert("agent=" + agent + "major=" + this.major + " minor=" + this.minor + " mac?=" + this.mac + " ns4?=" + this.ns4 + " win?=" + this.win + " ns5?=" + this.ns5);
}

//Load Stylesheet based on browser and platform.
var is = new Is();
if (is.ie) {
	//ie - Win
	if (is.win){
		document.write('<!------- ie Win Stylesheet in use -------------->');
		document.write('<link rel=stylesheet type="text/css" href="/uk/include/css/mattel_style.css">');
	}
	//ie - Mac
	if (is.mac){
		document.write('<!------- ie Mac Stylesheet in use -------------->');
		document.write('<link rel=stylesheet type="text/css" href="/uk/include/css/mattel_style_ns.css">');
	}
}
	
if (is.ns4 || is.ns4b || is.ns5) {
	//ns - Win
	if (is.win){
		document.write('<!------- ns Win Stylesheet in use -------------->');
		document.write('<link rel=stylesheet type="text/css" href="/uk/include/css/mattel_style_ns.css">');
	}
	//ns - Mac
	if (is.mac){
		document.write('<!------- ns Mac Stylesheet in use -------------->');
		document.write('<link rel=stylesheet type="text/css" href="/uk/include/css/mattel_style_ns.css">');
	}
}
