//
// iewarning.js (c) 2003 Edward H. Trager
//

///////////////////////////////////////////////
//
// Using "document.all" as a proxy indicating 
// Internet Explorer:
//
///////////////////////////////////////////////
var LOOKS_LIKE_IE=false;
if(document.all){
	if(navigator.userAgent.indexOf("Opera")>0){
		LOOKS_LIKE_IE=false;
	}else{
		LOOKS_LIKE_IE=true;
	}
}




//
// checkForIE():
//
function checkForIE(){
	
	if(LOOKS_LIKE_IE){

		//
		// IE 6 on Windows does not handle the "fixed" navigation properly,
		// so we compromise by changing it to "absolute" on IE (Windows) only: 
		// 
		// But IE 7.0 seems to understand "fixed" so only do this for IE!=7.0:
		// 
		// Also, preliminary evidence suggests that messing with the DOM nodes
		// (in createMessage()) is maybe not something we want to do yet in 
		// IE 7:
		//
		//if(!navigator.userAgent.indexOf("MSIE 7.0")){
			//
			// Warn the user about the problems with viewing in IE (prior to 7.0):
			//
			//createMessage();
		
			document.getElementById("menu").style.position="absolute";
			document.getElementById("news").style.position="absolute";
			//
			// Here we "downgrade" the transparent png to an indexed
			// 8-bit PNG which looks a little jagged but IE can handle it:
			//
			document.getElementById("title").style.backgroundImage="url('../images/unifontlogo-idx.png')";
		//}
		
	}
	
}

//
// createMessage()
//
function createMessage(){
	
	var messageNode=document.getElementById("message");
	var warningText  = '<h1><img src="images/closingX.png" alt="Close this window" onclick="closeMessage();" />Note Bene:</h1>';
	warningText += '<p>';
	warningText += 'Our web pages adhere to <a href="http://www.w3c.org">W3C</a> ';
	warningText += 'web standards and will appear correctly in <em>all modern browsers ';
	warningText += 'except Internet Explorer</em>.  ';
	warningText += 'Internet Explorer has serious <a href="http://www.w3.org/Style/CSS/">CSS</a> ';
	warningText += 'bugs which Microsoft still has not fixed.</p>';
	warningText += '<p>For a better and more secure viewing experience, please consider downloading for free your choice of ';
	warningText += '<a href="http://www.getfirefox.com">Firefox</a>, ';
	warningText += '<a href="http://www.opera.com">Opera</a>, ';
	warningText += '<a href="http://www.apple.com/safari/download/">Safari</a>, ';
	warningText += 'or <a href="http://www.konqueror.org/">Konqueror</a> ';
	warningText += 'for viewing this web site.</p>';
	warningText += '<p><a onclick="closeMessage();">Close Window</a></p>';
	
	messageNode.innerHTML=warningText;
	messageNode.style.display="block";

}

//
// function closeMessage()
//
function closeMessage(){
	
	var messageNode=document.getElementById("message");
	messageNode.style.display="none";
	
}



