var  curBrowser;

function checkBrowser(){
	//document.write("loaded js");
	var browserVer=navigator.userAgent;
	//alert(browserVer);
	if(browserVer.indexOf("MSIE 8")!==-1){curBrowser=11;} 													// IE 8
	if(browserVer.indexOf("MSIE 7")!==-1){curBrowser=0;} 													// IE 7
	if(browserVer.indexOf("MSIE 6")!==-1){curBrowser=1;} 													// IE 6
	if(browserVer.indexOf("MSIE 5")!==-1){curBrowser=2;} 													// IE 5
	if(browserVer.indexOf("MSIE 4")!==-1){curBrowser=3;} 													// IE 4
	if((browserVer.indexOf("Windows")!==-1) 	&& (browserVer.indexOf("Firefox")!==-1)){curBrowser=4;} 	// Firefox Win
	if((browserVer.indexOf("Mac OS X")!==-1) 	&& (browserVer.indexOf("Firefox")!==-1)){curBrowser=5;}		// Firefox Mac
	if((browserVer.indexOf("Linux")!==-1)		&& (browserVer.indexOf("Firefox")!==-1)){curBrowser=6;} 	// Firefox Linux
	if(browserVer.indexOf("Safari")!==-1){curBrowser=7;} 													// Safari Mac
	if((browserVer.indexOf("Windows")!==-1) 	&& (browserVer.indexOf("AOL")!==-1)){curBrowser=8;} 		// AOL Windows
	if((browserVer.indexOf("Mac OS X")!==-1) 	&& (browserVer.indexOf("AOL")!==-1)){curBrowser=9;} 		// AOL Mac
	if((browserVer.indexOf("Mac OS X")!==-1) 	&& (browserVer.indexOf("Netscape")!==-1)){curBrowser=10;} 	// Netscape Mac
	var constructInclude="";
	var specialIncludes=["IE7","IE6","IE5","IE4","FFWin","FFMac","FFLin","Safari","AOLWin","AOLMac","NSMac","IE8"];
	var includeMe=(specialIncludes[curBrowser]);
	var outString="<link href='/masterpages/styles/"+includeMe+".css' rel='stylesheet' type='text/css' media='screen' />";
	document.write(outString);
}


/******************************************************************************************************************************
	This function includes page specific CSS files in order to handle strange browser issues and page specific formatting. 
	For example some pages in IE 7 tend to scroll to infinity without this fix. whichBrowser is a numeric value as per the 
	checkBrowser script and includeMe is the name of the CSS file that fixes the specific issue. The files will be as generic 
	and reusable as possible, but considering the need for these files - it could generate many small (1K or small) css files. 
	These files will be stored in the /masterpages/styles/patches/ directory on the server. The word "patch_" is the prefix for
	any files created within this directory and it is automatically included when a file is included. Also .css is auto included
******************************************************************************************************************************/ 

function browserSpecificFile(whichBrowser,includeMe){
	if (curBrowser==whichBrowser){
		var outString="<link href='/masterpages/styles/patches/patch_"+includeMe+".css' rel='stylesheet' type='text/css' media='screen' />";
		document.write(outString);
	}
}


function thisYear(){
	var itis=Date.getFullYear();
	alert(itis);
}

checkBrowser();