var brwsr;
var OutActive = 0;

function init2() 
{
    //detect browser
    GetBrowser();

    if(brwsr == "nn4")
	{
	LSideShown = document.Interface.document.LSidebar1;
	OutShown = document.Interface.document.Content.document.Content1;
	}
    else if(brwsr == "ie4")
	{
	LSideShown = LSidebar1.style;
	OutShown = Content1.style;
	}
    else
	{
	LSideShown = document.getElementById("LSidebar1");
	OutShown = document.getElementById("Content1").style;
	}

    LSideNew = "none";
    OutNew = "none";
    OutShown.xpos = 0;
    OutNew.xpos = 0;
    placeStuff();
}


/*#########################################################

    BROWSER SNIFFER
    -----------------------------------------------------
    The browser sniffer test the value of the [is] object
    to detect the presence of a DHTML compatible browser,
    Netscape 4x and Explorer 4x and up..

###########################################################*/

function Is() {
    var agent = navigator.userAgent.toLowerCase();
    this.major = parseInt(navigator.appVersion);
    this.minor = parseFloat(navigator.appVersion);

    //As far as I know, all borowsers version 5+ support standard Javascript.
    if(this.major >= 5) {
	this.standard = true;
    }
    else if(agent.indexOf("msie 5") != -1 || agent.indexOf("msie 6") != -1) {
	this.standard = true;
	this.ie5 = true;
    }
    else if(this.ns = ((agent.indexOf('mozilla')!=-1) && ((agent.indexOf('spoofer')==-1) && (agent.indexOf('compatible') == -1)))) {
	this.ns2 = (this.ns && (this.major == 2));
	this.ns3 = (this.ns && (this.major == 3));
	this.ns4b = (this.ns && (this.minor < 4.04));
	this.ns4 = (this.ns && (this.major >= 4));
    }
    else if(this.ie  = (agent.indexOf("msie") != -1)) {
	this.ie3  = (this.ie && (this.major == 2));
	this.ie4  = (this.ie && (this.major >= 4));
    }
    else {}
}

var is = new Is();

/*#########################################################

    DOCUMENT OBJECT SWITCH
    -----------------------------------------------------
    The object switch is a basic tool for setting 
    specific Document Lyrect Model variables that
    can be used to build a single function readable 
    by different DHTML browsers.

###########################################################*/

if(is.standard) {
  doc = 'document.getElementById("';
  sty = '").style';
  htm = '")';
}
else if(is.ns4) {
  doc = "document.";
  sty = "";
  htm = "";
}
else if(is.ie4) {
  doc = 'document.all["';
  sty = '"].style';
  htm = '"]';
  is.standard=true;
}





function placeStuff()
{
    if(is.ns4){
	available_width=innerWidth;
	available_height=innerHeight;}
    else{
	available_width=document.body.clientWidth;
	available_height=document.body.clientHeight;}
	
	TopLyr = eval(doc + "Top" + sty);
	TopLyr.top = parseInt(available_height/2-175);
	TopLyr.left = parseInt(available_width/2-338);
	
	BottomLyr = eval(doc + "Bottom" + sty);
	BottomLyr.top = parseInt(available_height/2+175-24);
	BottomLyr.left = parseInt(available_width/2-338);
	
	Bar1Lyr = eval(doc + "Bar1" + sty);
	Bar1Lyr.top = parseInt(available_height/2-175+24);
	Bar1Lyr.left = parseInt(available_width/2-338);
	
	Bar2Lyr = eval(doc + "Bar2" + sty);
	Bar2Lyr.top = parseInt(available_height/2-175+24);
	Bar2Lyr.left = parseInt(available_width/2-338+19+116);
	
	Bar3Lyr = eval(doc + "Bar3" + sty);
	Bar3Lyr.top = parseInt(available_height/2-175+24);
	Bar3Lyr.left = parseInt(available_width/2+338-9);
	
	InterfaceLyr = eval(doc + "Interface" + sty);
	InterfaceLyr.top = parseInt(available_height/2-175+24);
	InterfaceLyr.left = parseInt(available_width/2-338-10);


		
}

function Out(which) 
{
    if(brwsr == "nn4") OutNew = eval("document.Interface.document.Content.document.Content" + which);
    else if(brwsr == "ie4") OutNew = eval("Content" + which + ".style;");
    else OutNew = eval("document.getElementById('Content" + which + "').style;");

    if ((OutActive == 0) && (OutShown != OutNew)) 
	{
      OutActive = 1;
	OutNew.xpos = -450;
	OutLeft();
    	}
}

function OutLeft() 
{
    if (OutShown.xpos > -450) 
	{
	OutShown.xpos -= 25;
	OutShown.left = OutShown.xpos;
	setTimeout("OutLeft()",25);
	}
    else 
      {
	OutShown.visibility = "hidden";
	OutNew.visibility = "visible";
	OutRight();
      }
}

function OutRight() 
{
    if (OutNew.xpos < 0) 
 	{
	OutNew.xpos += 25;
	OutNew.left = OutNew.xpos;
	setTimeout("OutRight()",25);
	}
    else 
    	{
	OutShown = OutNew;
	OutActive = 0;
    	}
}

function LSide(which) 
{
    if(brwsr == "nn4") LSideNew = eval("document.Interface.document.LSidebar" + which);
    else if(brwsr == "ie4") LSideNew = eval("LSidebar" + which + ".style;");    
    else LSideNew = eval("document.getElementById('LSidebar" + which + "').style;");

    if (!OutActive && LSideShown != LSideNew) 
    	{
      OutActive = 1;
	LSideShown.visibility = "hidden";
	LSideNew.visibility = "visible";
	LSideShown = LSideNew;
	OutActive = 0;
    	}
}

function GetBrowser()
{
    if (parseFloat(navigator.appVersion) >= 4) 
	{
	info = navigator.userAgent.toLowerCase();
	
	if (info.indexOf("msie") != -1)
	  {
	  if (info.indexOf("msie 5") == -1) brwsr = "ie4";
	  else brwsr = "ie5";
	  }
    	else
	  {
	  if (parseFloat(navigator.appVersion) >= 5) brwsr = "nn6";
	  else brwsr = "nn4";
	  }
	}
    else document.write('Get a new browser, fool.<br><A HREF="http://www.netscape.com/download/">Netscape</A><br><A HREF="http://www.microsoft.com/ie/">Internet Explorer</A>');
}
