// Decide browser version
var ns4 = (document.layers)? true:false;
var ns6 = (document.getElementById)? true:false;
var ie4 = (document.all)? true:false;
var ie5 = false;
// Microsoft Stupidity Check(tm).
if (ie4) {
	if (navigator.userAgent.indexOf('MSIE 5')>0) { var ie5 = true;}
	if (ns6) {var ns6 = false;}
}

/* http://www.xs4all.nl/~ppk/js/detect.html Browser detection */

var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{	browser = "Konqueror"; OS = "Linux";
}
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "IE"
else if (!checkIt('compatible'))
{ 	browser = "Netscape"
	version = detect.charAt(8);
}
else browser = "unknown";
if (!version) version = detect.charAt(place + thestring.length);
if (!OS)
{ if (checkIt('linux')) OS = "Linux";
	else if (checkIt('x11')) OS = "Unix";
	else if (checkIt('mac')) OS = "Mac"
	else if (checkIt('win')) OS = "Windows"
	else OS = "unknown";
}
function checkIt(string)
{ 	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
// alert("Browser: "+browser+" OS:"+OS);
// End browser detection
/* Call: openwin("file.html",width,height,"options list" )
 Options: toolbar=[yes|no|1|0] location=[yes|no|1|0] 
      directories=[yes|no|1|0] status  =[yes|no|1|0] 
         menubar =[yes|no|1|0] scrollbars= [yes|no|1|0] 
        resizable=[yes|no|1|0] width=pixels height=pixels	
*/

// Call: openwin("file.html",width,height,"options list" )
function openwin(fname,x,y,options){
    if (arguments[2]==null) { x="522"; y="402" } 
    if (arguments[3]==null) { options="toolbar=1,menubar=0,scrollbars=1,resizable=yes, left=10,screenX=10,top=10,screenY=10"}
    options = "width="+ x +", height="+ y +"," + options;
	    if(ns6==true) 
    {	win = window.open("","NS6",options);
	win.location.href = fname;
	win.opener=window.self;					
    } else { // For non-NS6 browsers
	var win = window.open(fname,"mywin", options) 
   }
   if (!win.opener) {win.opener = win}	{
	win.focus(); 
	win.resizeTo(x,y);
  	win.document.close();
   }
//set_status();   
}
function setPage (newAddress) {
if (newAddress != "") { window.location.href = newAddress; }
}

