var subState
var mainState
var menutabs={

	subcontainers:[], last_accessed_tab:null,

	revealsubmenu:function(curtabref){
	this.hideallsubs()
	if (this.last_accessed_tab!=null){
		this.last_accessed_tab.className=""
		//alert("off") 
	}	
	if (curtabref.getAttribute("rel")){ 
	document.getElementById(curtabref.getAttribute("rel")).style.display="block"
	curtabref.className="current"
	this.last_accessed_tab=curtabref
	}
	if (subState =="off" && mainState =="off"){ 
		//alert("asjdhasdjksdhs")
		//this.last_accessed_tab.className=""
		//this.hideallsubs()
		//set sub and main stet in index.htm using mouseover
		
	}

	},	

	hideallsubs:function(){
		for (var i=0; i<this.subcontainers.length; i++)
		document.getElementById(this.subcontainers[i]).style.display="none"
	},
	

init:function(menuId){
	var tabItems=document.getElementById(menuId).getElementsByTagName("a")
		for (var i=0; i<tabItems.length; i++){
			if (tabItems[i].getAttribute("rel")){
				this.subcontainers[this.subcontainers.length]=tabItems[i].getAttribute("rel")
			}
			/* selectedIndex was a parameter
			if (i==selectedIndex){ 
				tabItems[i].className="current"
				this.revealsubmenu(tabItems[i])
			}*/
			if (tabItems[i].className == "current")
			    this.revealsubmenu(tabItems[i])
			    
		tabItems[i].onmouseover=function(){
		menutabs.revealsubmenu(this)
		

		}
		} 
	}
}
// ------------------------ NEW JAVSCRIPT FUNCTION---------------------------------------------//


function setClass(e){
	var initialYPosition 	
    var posx = 0;
    var posy = 0;
    if (!e) var e = window.event;
    if (e.pageX || e.pageY)
    {
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY)
    {
        posx = e.clientX;
        posy = e.clientY;
    }
	if ( posy <= 106  || posy >= 155  || posx <= 174 || posx >= 901){
	/*	document.getElementById("car").style.display="none"
		document.getElementById("main_car").setAttribute("className", "") // IE will see this line
		document.getElementById("main_car").setAttribute("class", "") // Firefox will see this line
		
		document.getElementById("home").style.display="none"
		document.getElementById("main_home").setAttribute("className", "") // IE will see this line
		document.getElementById("main_home").setAttribute("class", "") // Firefox will see this line
		
		document.getElementById("travel").style.display="none"
		document.getElementById("main_travel").setAttribute("className", "") // IE will see this line
		document.getElementById("main_travel").setAttribute("class", "") // Firefox will see this line


		document.getElementById("pet").style.display="none"
		document.getElementById("main_pet").setAttribute("className", "") // IE will see this line
		document.getElementById("main_pet").setAttribute("class", "") // Firefox will see this line


		document.getElementById("pleasure_craft").style.display="none"
		document.getElementById("main_pleasure_craft").setAttribute("className", "") // IE will see this line
		document.getElementById("main_pleasure_craft").setAttribute("class", "") // Firefox will see this line

		document.getElementById("business").style.display="none"
		document.getElementById("main_business").setAttribute("className", "") // IE will see this line
		document.getElementById("main_business").setAttribute("class", "") // Firefox will see this line		
		*/
	}
}

function checkY(e){
	var initialYPosition 	
    var posx = 0;
    var posy = 0;
    if (!e) var e = window.event;
    if (e.pageX || e.pageY)
    {
        posx = e.pageX;
        posy = e.pageY;
    }
    else if (e.clientX || e.clientY)
    {
        posx = e.clientX;
        posy = e.clientY;
    }
		alert(posx)
}
