/* 
==================================================================================
Browser sniffer and CSS deployment
==================================================================================
*/

// determine platform
if (navigator.platform.indexOf("Mac") != -1 ) {myPlat = "mac";}
if (navigator.platform.indexOf("Win" ) != -1 ) {myPlat = "pc";}

// determine browser version number and associate to it's equivalent to reduce CSS file overhead
if (myPlat=="mac") {
if (navigator.appVersion.indexOf("MSIE 3.") != -1 ) {myBv = "4";} // mac ie3
else if (navigator.appVersion.indexOf("MSIE 4.") != -1 ) {myBv = "4";} // mac ie4
else if (navigator.appVersion.indexOf("MSIE 5.") != -1 ) {myBv = "5";} // mac ie5
else if (navigator.appVersion.indexOf("MSIE 6.") != -1 ) {myBv = "5";} // mac ie6
else if (navigator.appVersion.indexOf("3.") != -1 ) {myBv = "4";} //mac nn3
else if (navigator.appVersion.indexOf("4.") != -1 ) {myBv = "4";} // mac nn4
else if (navigator.appVersion.indexOf("5.") != -1 ) {myBv = "5";} // mac nn6
// support future standards-compliant versions with default value of 5
else {myBv = "5";}
}

// use single .css file for pc
if (myPlat=="pc") { {myBv = "";}  }

// failsafe for unix, linux etc.
if (myPlat==""){ {myPlat = "pc";} {myBv = "";}  }	


// *****!!!!!!@@@@@@@@!!!!!!!!*******
// disable browser-specific styles, send all to pc.css
//document.write("<LINK REL='Stylesheet' HREF='" + myRoot + "css/" + myPlat + myBv + ".css'>");
document.write("<LINK REL='Stylesheet' HREF='" + myRoot + "css/pc.css'>");


/* 
==================================================================================
Netscape 4/CSS Resize Bug fix
==================================================================================
*/
var Nav4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4))
if (Nav4 && !window.startWidth) {
	var startWidth = window.innerWidth 
	var startHeight = window.innerHeight
}
function restorePage() {
	if (Nav4) {
		if(startWidth != window.innerWidth || startHeight != window.innerHeight)
		{
			location.reload()
		}
	}
}
// workaround for difference in mac-nn resize handler syntax
if (Nav4 && (myPlat=="mac")){
window.onresize = restorePage();} //mac nn syntax
//else {window.onresize = restorePage;} //win syntax



/* 
=========================================
GENERAL functions
=========================================
*/
function openFlashcards(fcPath) { 
window.open(fcPath,'myFlash','toolbar=0,location=0,status=0,menubar=0,scrollbars=auto,resizable=1,width=580,height=500');
}

function openHint(hinturl)
{
var hintWindow = window.open(hinturl, 'Hint', 'height=400,width=500,toolbar=no,resizable=yes,scrollbars=yes');
if(hintWindow.opener == null) hintWindow.opener = window;
hintWindow.focus();
}



/* 
=========================================
Knight functions
=========================================
*/

function apOpenWin(theURL) {   window.open(theURL,"apWin","toolbar=1,location=0,directories=0,status=0,menubar=0,scrollbars=auto,resizable=1,height=520,width=740");
}

// bullet
var nv7,nu=navigator.userAgent,b1='&#8227;',b2='<span class=dingBullet>4<\/span>';
if (nu.indexOf("Netscape/7") != -1){nv7=true}
var bullet=nv7?b1:b2
