var brwsr;
var MoveActive = 0;
var WhereAmI = 0;
var DescriptionVariable = 0;
var initvalue;

function init() 
{
    //detect browser
 //   GetBrowser();

    if(is.nn4)
	{
	ThingMoving1 = document.MainInterface;
	ThingMoving2 = document.MenuTab;
	Roo = document.RooHead;
	}
    else if(is.ie4)
	{
	ThingMoving1 = MainInterface.style;
	ThingMoving2 = MenuTab.style;
	Roo = RooHead.style;
	}
    else
	{
	ThingMoving1 = document.getElementById("MainInterface").style;
	ThingMoving2 = document.getElementById("MenuTab").style;
	Roo = document.getElementById("RooHead").style;
	}
	
    if(is.ns4){
	available_width=innerWidth;
	available_height=innerHeight;}
    else{
	available_width=document.body.clientWidth;
	available_height=document.body.clientHeight;}
	
    if(initvalue==0){
      ThingMoving1.xpos = parseInt(available_width/2-237);
      ThingMoving2.xpos = parseInt(available_width/2+233);}
    else {
	WhereAmI = 1;
      ThingMoving1.xpos = parseInt(available_width/2-237)-475;
      ThingMoving2.xpos = parseInt(available_width/2+233)-475;}

    Roo.xpos = 0;
    placeMenuStuff();

}

/*#########################################################

    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 placeMenuStuff()
{
    if(is.ns4){
	available_width=innerWidth;
	available_height=innerHeight;}
    else{
	available_width=document.body.clientWidth;
	available_height=document.body.clientHeight;}
	
	MainInterfaceLyr = eval(doc + "MainInterface" + sty);
	MainInterfaceLyr.top = parseInt(available_height/2-214);
	
	MenuTabLyr = eval(doc + "MenuTab" + sty);
	MenuTabLyr.top = parseInt(available_height/2-40);
	
	RooHeadLyr = eval(doc + "RooHead" + sty);
	RooHeadLyr.top = parseInt(available_height/2-140);
	RooHeadLyr.left = 0;

	if(initvalue==0){
	  MainInterfaceLyr.left = parseInt(available_width/2-237);
	  MenuTabLyr.left = parseInt(available_width/2+233);
	  RooHeadLyr.visibility = "hidden";}
	else{
	  MainInterfaceLyr.left = -475;
	  MenuTabLyr.left = -4;
	  RooHeadLyr.visibility = "visible";}
	
	Button1Lyr = eval(doc + "Button1" + sty);
	Button1Lyr.top = 46;
	Button1Lyr.left = 63;
	
	Button2Lyr = eval(doc + "Button2" + sty);
	Button2Lyr.top = 115;
	Button2Lyr.left = 15;

	Button3Lyr = eval(doc + "Button3" + sty);
	Button3Lyr.top = 195;
	Button3Lyr.left = 5;
	
	Button4Lyr = eval(doc + "Button4" + sty);
	Button4Lyr.top = 270;
	Button4Lyr.left = 30;
	
	Button5Lyr = eval(doc + "Button5" + sty);
	Button5Lyr.top = 325;
	Button5Lyr.left = 90;
	
	Button6Lyr = eval(doc + "Button6" + sty);
	Button6Lyr.top = 46;
	Button6Lyr.left = 332;
	
	Button7Lyr = eval(doc + "Button7" + sty);
	Button7Lyr.top = 115;
	Button7Lyr.left = 378;
	
	Button8Lyr = eval(doc + "Button8" + sty);
	Button8Lyr.top = 195;
	Button8Lyr.left = 388;
	
	Button9Lyr = eval(doc + "Button9" + sty);
	Button9Lyr.top = 270;
	Button9Lyr.left = 363;
	
	Button10Lyr = eval(doc + "Button10" + sty);
	Button10Lyr.top = 325;
	Button10Lyr.left = 305;

	Button96Lyr = eval(doc + "Button96" + sty);
	Button96Lyr.top = 0;
	Button96Lyr.left = 318;

	Button97Lyr = eval(doc + "Button97" + sty);
	Button97Lyr.top = 289;
	Button97Lyr.left = 0;

	Button98Lyr = eval(doc + "Button98" + sty);
	Button98Lyr.top = 289;
	Button98Lyr.left = 318;

	Button99Lyr = eval(doc + "Button99" + sty);
	Button99Lyr.top = 0;
	Button99Lyr.left = 0;

	ChooseLyr = eval(doc + "Choose" + sty);
	ChooseLyr.top = 355;
	ChooseLyr.left = 150;
	
	LogoLyr = eval(doc + "Logo" + sty);
	LogoLyr.top = 00;
	LogoLyr.left = 108;
	
	DescriptionLyr = eval(doc + "Description" + sty);
	DescriptionLyr.top = 120;
	DescriptionLyr.left = 137;
	
	Description1Lyr = eval(doc + "Description1" + sty);
	Description2Lyr = eval(doc + "Description2" + sty);
	Description3Lyr = eval(doc + "Description3" + sty);
	Description4Lyr = eval(doc + "Description4" + sty);
	Description5Lyr = eval(doc + "Description5" + sty);
	Description6Lyr = eval(doc + "Description6" + sty);
	Description7Lyr = eval(doc + "Description7" + sty);
	Description8Lyr = eval(doc + "Description8" + sty);
	Description9Lyr = eval(doc + "Description9" + sty);
	Description10Lyr = eval(doc + "Description10" + sty);
	Description11Lyr = eval(doc + "Description11" + sty);
	Description12Lyr = eval(doc + "Description12" + sty);
	Description96Lyr = eval(doc + "Description96" + sty);
	Description97Lyr = eval(doc + "Description97" + sty);
	Description98Lyr = eval(doc + "Description98" + sty);
	Description99Lyr = eval(doc + "Description99" + sty);
	Description0Lyr = eval(doc + "Description0" + sty);
	DescriptionVariable = eval(doc + "Description0" + sty);
	
	BigRooLyr = eval(doc + "BigRoo" + sty);
	BigRooLyr.top = 70;
	BigRooLyr.left = 48;
	
	EmptyRooLyr = eval(doc + "EmptyRoo" + sty);
	EmptyRooLyr.top = 70;
	EmptyRooLyr.left = 48;
	
	EmptyCircleLyr = eval(doc + "EmptyCircle" + sty);
	EmptyCircleLyr.top = 0;
	EmptyCircleLyr.left = 0;
	


	timer_0 = setInterval("vCenterMenu()", 500);

}
	

function Move()
{
	if(brwsr == "nn4")  
	{
	ThingMoving1 = eval("document.MainInterface");
	ThingMoving2 = eval("document.MenuTab");
	}
	else if(brwsr == "ie4") 
	{
	ThingMoving1 = eval("MainInterface" + ".style;");
	ThingMoving2 = eval("MenuTab" + ".style;");
	}
	else 
	{
	ThingMoving1 = eval("document.getElementById('MainInterface" + "').style;");
	ThingMoving2 = eval("document.getElementById('MenuTab" + "').style;");
	}
	
	if ((MoveActive == 0) && (WhereAmI == 0))
		{
		RooHeadLyr.visibility = "visible";
		MoveActive = 1;
		MoveLeft();
		}
	else if ((MoveActive == 0) && (WhereAmI == 1))
		{
		RooHeadLyr.visibility = "hidden";
		MoveActive = 1;
		MoveRight();
		}
}

function HoverYes(which)
{
	DescriptionVariable.visibility = "hidden";
	DescriptionVariable = eval(doc + "Description" + which + sty);
	EmptyRooLyr.visibility = "visible";
	DescriptionVariable.visibility = "visible";
}

function HoverNo()
{
	DescriptionVariable.visibility = "hidden";
	DescriptionVariable = eval(doc + "Description0" + sty);
	EmptyRooLyr.visibility = "hidden";
	DescriptionVariable.visibility = "visible";
}

function MoveLeft()
{
	if (ThingMoving1.xpos > -455)
		{
		ThingMoving1.xpos -= 20;
		ThingMoving1.left = ThingMoving1.xpos;
		ThingMoving2.xpos -= 20;
		ThingMoving2.left = ThingMoving2.xpos;
		setTimeout("MoveLeft()",20);
		}
	else
		{
		ThingMoving1.left = -475;
		ThingMoving2.left = -4;
		MoveActive = 0;
		WhereAmI = 1;
		RooHeadLyr.visibility = "visible";
		}
}
		
function MoveRight()
{
	if (ThingMoving1.xpos < (parseInt(available_width/2-257)))
		{
		ThingMoving1.xpos += 20;
		ThingMoving1.left = ThingMoving1.xpos;
		ThingMoving2.xpos += 20;
		ThingMoving2.left = ThingMoving2.xpos;
		setTimeout("MoveRight()",20);
		}
	else
		{
		ThingMoving1.left = (parseInt(available_width/2-237));
		ThingMoving2.left = (parseInt(available_width/2+233));
		MoveActive = 0;
		WhereAmI = 0;
		}
}

function vCenterMenu() {

 if(is.ns4){}
 else	{
	MainInterfaceLyr.top = document.body.scrollTop+(available_height/2-214);
	MenuTabLyr.top = document.body.scrollTop+(available_height/2-40);
	RooHeadLyr.top = document.body.scrollTop+(available_height/2-140);
	}
}

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.<br><A HREF="http://www.netscape.com/download/">Netscape</A><br><A HREF="http://www.microsoft.com/ie/">Internet Explorer</A>');
}

