/**
 * This scripts append to the class name of the html element the navigator informations
 */

function appendNavigatorInformations()
{
	var list = document.getElementsByTagName("html");
	if ( list != null && list.length > 0 )
	{
		// presume that only one html tag has been declared 
		var html = list.item(0);
		
		// get it's class name
		var className = html.className;

		// append the browser informations
		if ( className.length > 0 )
		{
			className += " ";
		}

		// get the browser
		var browser = Browser.Instance;
	
		// append the browser code
		className += browser.code;
		
		// if the browser is a Gecko browser, append it !
		if ( browser.isGecko )
		{
			className += " Gecko";
			className += " NotSafari NotOpera NotMSIE";
		}
		else if ( browser.isFirefox )
		{
			className += " NotNetscape NotSafari NotOpera NotMSIE";
		}
		if ( browser.isNetscape )
		{
			className += " NotFirefox NotSafari NotOpera NotMSIE";
		}
		if ( browser.isMSIE )
		{
			className += " NotGecko NotFirefox NotNetscape NotSafari NotOpera";
		}
		else if ( browser.isSafari )
		{
			className += " NotGecko NotFirefox NotNetscape NotOpera NotMSIE";
		}
		else if ( browser.isOpera )
		{
			className += " NotGecko NotFirefox NotNetscape NotSafari NotMSIE";
		}

		// finally, replace the classname of the html element
		html.className = className;
	}
}

function loadCSS()
{

	// <LINK REL="StyleSheet" HREF="/a2v2006/styles/2006/main.css"     TYPE="text/css" MEDIA="all" />
	// <LINK REL="StyleSheet" HREF="/a2v2006/styles/2006/screen.css"   TYPE="text/css" MEDIA="screen" />
	// <LINK REL="StyleSheet" HREF="/a2v2006/styles/2006/print.css"    TYPE="text/css" MEDIA="print" />
	
	var list = document.getElementsByTagName("head");
	if ( list != null && list.length > 0 )
	{
		
		// presume that only one head tag has been declared 
		var head = list.item(0);

		var style = null;
		
		style 	= document.createElement("LINK");
		style.href 	= "/a2v2006/styles/2006/main.css";
		style.rel	= "stylesheet";
		style.type 	= "text/css";
		style.media = "all";

		head.appendChild(style);

		style 	= document.createElement("LINK");
		style.href 	= "/a2v2006/styles/2006/screen.css";
		style.rel	= "stylesheet";
		style.type 	= "text/css";
		style.media = "screen";
		
		head.appendChild(style);
		
		style 	= document.createElement("LINK");
		style.href 	= "/a2v2006/styles/2006/print.css";
		style.rel	= "stylesheet";
		style.type 	= "text/css";
		style.media = "print";

		head.appendChild(style);
	}
}

appendNavigatorInformations();
/*loadCSS();*/

/*function initCSS()
{
	// call the function

	loadCSS();
}*/

/**
 * Add 
 */
/*if (window.addEventListener) 
{
    window.addEventListener ("load", initCSS, true);
} 
else
{
    window.attachEvent ("onload", initCSS);
}*/
		

