//
// iewarning.js (c) 2003 Edward H. Trager
//

//
// hackForIE():
//
function hackForIE(){
	//alert(navigator.userAgent);
	//alert(navigator.userAgent.indexOf("MSIE"));
	//alert(navigator.userAgent.indexOf("Opera"));
	//alert(navigator.userAgent.indexOf("Gecko"));
	
	//alert(navigator.appName);
	//alert(navigator.appVersion);
	
	//
	// We can normally distinguish a true IE from, say, Opera masquerading as IE
	// from the presence of "MSIE" _and_ absence of "Opera" (or whatever other browser name)
	// in the userAgent string.  However some browsers, such as Konqueror, will give up all
	// traces of their own identity when implementing the "hack" to identify themselves as
	// IE.  However, since that is not the default behaviour, I feel the following is
	// sufficient for distinguishing within the class of recent DOM-enabled browsers:
	//
	//if(navigator.userAgent.indexOf("MSIE")){
	var agent=navigator.userAgent;
	if(agent.indexOf("MSIE")>0){
		//
		// Check against other browsers masquerading as IE:
		//
		if(agent.indexOf("Opera")>0) return;
		if(agent.indexOf("Gecko")>0) return;
		if(agent.indexOf("Konqueror")>0) return;
		if(agent.indexOf("KHTML")>0) return;
		if(agent.indexOf("Safari")>0) return;
		
		//
		// Warn the user about the problems with viewing in IE:
		//
		var WarningParagraph = document.createElement("P");
		WarningParagraph.style.color="#a00";
		WarningParagraph.style.padding="3px";
		WarningParagraph.style.fontSize="14px";
		WarningParagraph.style.backgroundColor="#ff9";
		var IEWarning = document.createTextNode("Warning: Internet Explorer has serious bugs in its implementation of CSS which cause this page to appear and behave differently than intended! Please use Mozilla, Opera, Konqueror, or Safari instead!");
		WarningParagraph.appendChild(IEWarning);
		//document.getElementById("navigation").firstChild.appendChild(WarningParagraph);
		document.getElementById("navigation").insertBefore(WarningParagraph,document.getElementById("navigation").firstChild);
		//
		// IE on Windows does not handle the "fixed" navigation properly,
		// so we compromise by changing it to "absolute" on IE (Windows) only: 
		//
		document.getElementById("navigation").style.position="absolute";
		
	}
	
}
