function getDefaultJavaMinor() {return 4;}
function canUseJavaPlugin()
{
if(isIE())return true;
if(isNetscape()){
var _info = navigator.userAgent;
if(
(_info.indexOf("Win")   > 0 &&
_info.indexOf("Win16") < 0 &&
java.lang.System.getProperty("os.version").indexOf("3.5") <  0)
|| _info.indexOf("Sun") > 0
|| _info.indexOf("Linux") > 0
)return true;
}
return false;
}
function openHome(pathToMain,u,sessionVar)
{
if(u == null)u = "index.php";
u = pathToMain + u;
if(sessionVar != null)u += sessionVar;
if(self.opener == null)location = u;
else {
self.opener.focus();
self.opener.location = u;
}
}
function loadManual(u,sessionVar)
{
if(u == null)u="xo/index.php";
if(sessionVar != null)u += sessionVar;
windowPointer = window.open(u, "Manual");
windowPointer.focus();
}
function preferences(toroot)
{
var u = toroot+"session_preferences.php";
windowPointer = window.open(u, "MyPreferences","width=300 height=500");
windowPointer.focus();
}
function runTools(u)
{
windowPointer = window.open(u, "Tools");
windowPointer.focus();
}
function runJava(javadir,pageDir,page,ext,arg)
{
location = javaRunFile(javadir,pageDir,page,ext,arg);
}
//
function javaRunFile(javadir,pageDir,page,ext,arg)
{
if(pageDir != '')pageDir += "/";
//alert(pageDir+page+"."+ext);
if(canUseJavaPlugin()){
if(ext.indexOf("htm") >= 0){
//return javadir+page+"p."+ext+arg;
//return pageDir+page+"p."+ext+arg;
}
}
return pageDir+page+"."+ext+arg;
}
function showScore(appl_id)
{
window.open("php_lib/sg_show_score.php?appl_id=$appl_id","wallOfFame","toolbar=No,width=300,height=500");
//window.open("cgi-bin/sg_score.cgi" + "?file=" + scoreFile+"&title="+title,
//	"wallOfFame",
//	"toolbar=No width=300 height=500");
}
function runToolsCalc(toroot)
{
windowPointer = window.open(toroot+"flash_calc.html", "Calculator","toolbar=No,width=200,height=250,resizable=yes");
windowPointer.focus();
}
function runToolsCalendar(toroot)
{
windowPointer = window.open(toroot+"calendar_main.html", "Calendar","toolbar=No,width=300,height=350,resizable=yes");
windowPointer.focus();
}
function runToolsClock(toroot)
{
windowPointer = window.open(toroot+"clock.html", "Clock","toolbar=No,width=300,height=350,resizable=yes");
windowPointer.focus();
}
function runQuickGo(endHref)
{
windowPointer = window.open("quickgo.php", "QuickGo","toolbar=No,width=300,height=350,resizable=yes");
windowPointer.focus();
}
function createTollsMenu(toroot,imgdir,isLogin,isAdmin,endHref,endHref1)
{
var linkset=new Array()
linkset ='<BR>';
linkset +='<div class="menuitems">';
linkset +='<a href="#" onClick="JavaScript:runToolsCalendar('+ "'"+ toroot+ "'"+ ')">';
linkset +='<img width=16 height=16 border="0" src="'+imgdir+'java/calendar/calendar16.gif"> Calendar</a></div>';
linkset +='<div class="menuitems">';
linkset +='<a href="#" onClick="JavaScript:runToolsClock(' + "'"+ toroot+"'"+ ')">';
linkset +='<img width=16 height=16 border=0 src="'+imgdir+'clock.gif"> Clock</a></div>';
linkset +='<div class="menuitems">';
linkset +='<a href="#" onClick="JavaScript:runToolsCalc(' + "'"+ toroot+"'"+ ')">';
linkset +='<img width=16 height=16 border=0 src="'+imgdir+ 'java/calc/calc16.gif"> Calculator</a></div>';
if(isAdmin == 'Y'){
linkset +='<div class="menuitems">';
linkset +='<a target=_blank href="'+toroot+'env.php">';
linkset +='<img width=16 height=16 border=0 src="'+imgdir+'wrench16.gif"> Environment</a></div>';
}
linkset +='<div class="menuitems">';
linkset +='<a href="#" onClick="JavaScript:runToolsLobby()">';
linkset +='<img width=16 height=16 border=0 src="'+imgdir+ 'lobby.gif"> Lobby</a></div>';
linkset +='<div class="menuitems">';
linkset +='<a href="' + toroot+'preferences.php' + endHref1 + '">';
linkset +='<img width=16 height=16 border=0 src="'+imgdir+'java/property.gif"> Preferences</a></div>'
linkset +='<div class="menuitems">';
linkset +='<a href="#" onClick="JavaScript:runQuickGo(' + "'"+ endHref+"'"+ ')">';
linkset +='<img width=16 height=16 border=0 src="'+imgdir+ 'check.gif"> Quick Go</a></div>';
linkset +='<BR>';
return linkset;
}
