// JavaScript Document
fixCssForBrowser();

function fixCssForBrowser() {
	// Options for "theBrand" are:
	//  * MSIE 7
	//  * MSIE 6
	//  * Firefox
	//  * Safari
	//  * Opera
	// ...because I don't much care about any others
	var theBrand="";
	
	if(navigator.userAgent.indexOf("Firefox")!=-1) {
		theBrand="Firefox";
	}

	if(navigator.userAgent.indexOf("Opera")!=-1) {
		theBrand="Opera";
	}
	
	if(navigator.userAgent.indexOf("Safari")!=-1) {
		theBrand="Safari";
	}
	
	if(navigator.userAgent.indexOf("MSIE")!=-1) {
		var theVersionIndex   = navigator.userAgent.indexOf("MSIE") + 5;
		var theSemicolonIndex = navigator.userAgent.indexOf(";",theVersionIndex);
		var theVersionString  = navigator.userAgent.substr(theVersionIndex,(theSemicolonIndex-theVersionIndex));
		var theVersion=parseInt(theVersionString);
		if(theVersion==7) { 
			theBrand="MSIE7";
		} else {
			theBrand="MSIE6";
		}
	}
	
	var thePath="/pages/_styles";
	var theFile="fix_" + theBrand.toLowerCase() + ".css";
	document.write("<link rel='stylesheet' type='text/css' href='" + thePath + "/" + theFile + "' />");
}

