// -------------------------------------------------
// ----- © andy meier, mindpilot digital design
// -------------------------------------------------

var debugg = 0; 
// 1 oder 0

var basepath = 'http://www.bmi-bild.ch'; // -> anpassen!


if(navigator.platform.indexOf('Mac',0)+1){


	// -- microsoft compatible browser
	
	
	if(navigator.appVersion.indexOf('MSIE',0)+1){
		//alert('mac msie')

		document.write("<link rel=\"stylesheet\" href=\""+basepath+"/css/print_mac.css\" media=\"print\" type=\"text\/css\">")

		if(navigator.appVersion.indexOf('5.',0)+1){
		// --- alert('new msie mac');
		if(debugg == 1){popDebugg('mac_small.css')};
		
		document.write('<link rel=\"stylesheet\" href=\"'+basepath+'/css/mac_small.css\" media=\"screen\" type=\"text\/css\">')
		} 
		else { 
		// --- alert('old msie mac')
		if(debugg == 1){popDebugg('mac.css')};
		document.write("<link rel=\"stylesheet\" href=\""+basepath+"/css/mac.css\" media=\"screen\" type=\"text\/css\">")
		}
		
	}
	else {
	
		if(navigator.appVersion.indexOf('55',0)+1
		||navigator.appVersion.indexOf('6',0)+1
		||navigator.appVersion.indexOf('7',0)+1){
		// --- alert('mac netscape hoeher als 5')
		if(debugg == 1){popDebugg('mac_small')};
		document.write("<link rel=\"stylesheet\" href=\""+basepath+"/css/mac_small.css\" media=\"screen\" type=\"text\/css\">")
		}
	
	else {

	// --- alert('mac netscape vor 5.0')
	if(debugg == 1){popDebugg('mac.css')};
	document.write("<link rel=\"stylesheet\" href=\""+basepath+"/css/mac.css\" media=\"screen\" type=\"text\/css\">")
	}
}

} 

// --- its a windoze

else if(navigator.platform.indexOf('Win',0)+1) {

	//document.write("\r<link rel=\"stylesheet\" href=\""+basepath+"/css/print.css\" media=\"print\" type=\"text\/css\">")


	if(navigator.appVersion.indexOf('MSIE',0)+1){

		if(navigator.appVersion.indexOf('NT',0)+1
		|| navigator.appVersion.indexOf('98',0)+1
		|| navigator.appVersion.indexOf('Me',0)+1){
		// --- alert('win NT msie');
		if(debugg == 1){popDebugg('win_98nt.css')};

		document.write("\r<link rel=\"stylesheet\" href=\""+basepath+"/css/print_98nt.css\" media=\"print\" type=\"text\/css\">")
		document.write("<link rel=\"stylesheet\" href=\""+basepath+"/css/win_98nt.css\" media=\"screen\" type=\"text\/css\">")
		} else {
		// --- alert('win 9X msie '+navigator.appVersion);
		var stylelink = basepath+'/css/win.css';
		document.write('<link rel=\"stylesheet\" href=\"'+stylelink+'\" media=\"screen\" type=\"text\/css\">')
		if(debugg == 1){popDebugg(stylelink)};
		}
	}
	else {
	//alert('oha netscape')

	document.write("\r<link rel=\"stylesheet\" href=\""+basepath+"/css/print.css\" media=\"print\" type=\"text\/css\">")

	if(navigator.appVersion.indexOf('NT',0)+1){
	// --- alert('oha win NT Netscape');
	if(debugg == 1){popDebugg('win_moz_98nt.css')};
	document.write("<link rel=\"stylesheet\" href=\""+basepath+"/css/win_moz_98nt.css\" media=\"screen\" type=\"text\/css\">")
	} else {
	if(debugg == 1){popDebugg('win_moz.css')};
	document.write("\r<link rel=\"stylesheet\" href=\""+basepath+"/css/win_moz.css\" media=\"screen\" type=\"text\/css\">")}
	}

}

else{
	//alert('other');
	if(debugg == 1){popDebugg('other.css')};
		document.write("<link rel=\"stylesheet\" href=\""+basepath+"/css/other.css\" media=\"screen\" type=\"text\/css\">")
}

function popDebugg(stylesheet,breite,hoehe){

	jobName = "stylesheet-check > /jscrpt/getstyle.js";
	
	// dynamische html seite mit bild
	
	breite = "500";
	hoehe = "50";
	
	popWin = window.open("","popWin","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width="+breite+",height="+hoehe)
	parent.name="mainPage";
	
	popWin.document.write("<html>");
	popWin.document.write("<head><title>"+jobName+"</title></head>");
	popWin.document.write("<body link='#ffffff' bgcolor='#666666' marginwidth='5' marginheight='5' leftmargin='5' topmargin='5'>");
	popWin.document.write("<font color='#ffffff' size='1' face='verdana'>");
	popWin.document.write("<strong>stylesheet:</strong> "+stylesheet);
	popWin.document.write("<br><strong>browser:</strong> "+navigator.appVersion);
	popWin.document.write("</font>");
	popWin.document.write("</body></html>");

}
