$(document).ready(function(){
	var e, i = 0;
	while (e = document.getElementById('tabs').getElementsByTagName ('li') [i++]) {
		if (e.className == 'on' || e.className == 'off') {
		e.onclick = function () {
			var getEls = $('.dropdown ul li').get();
				for (var z=0; z<getEls.length; z++) { 
				getEls[z].className=getEls[z].className.replace('show', 'hide');
				getEls[z].className=getEls[z].className.replace('on', 'off');
				}
			this.className = 'on';
			var max = this.getAttribute('id');
			max = max.substr(0,max.length - 1);

			document.getElementById(max).className = "show tabs_li";
			}
		}
	}
});

$(document).ready(function(){
	//$('#tabs ul li').hover(function(){$(this).css("background","#e7e6e3");});
	//$('#tabs ul li span').first().css("background","#e7e6e3");
	$('#tabs ul li').bind("click", function(event){
		//$('#tabs ul li').removeClass("on").addClass("off");
		//$(this).removeClass("off").addClass("on");
		$('#tabs ul li span').css("background","#3d3d3d");
		$(this).children("span").css("background","#e7e6e3");
		//alert($('#tabs ul li').attr('class'));
		//$(this).addClass("on");
	})
});


onload = function() {
	var tab, i = 0;
	if(document.getElementById('route_tabs')) {
		while (tab = document.getElementById('route_tabs').getElementsByTagName ('li') [i++]) {
			if (tab.className == 'on' || tab.className == 'off') {
			tab.onclick = function () {
				var getEls = $('#route li').get();
				//$('#route').find("ul li").each(function(){
					for (var j=0; j<getEls.length; j++) {
					getEls[j].className=getEls[j].className.replace('show', 'hide');
					getEls[j].className=getEls[j].className.replace('on', 'off');
					}
				this.className = 'on';
				var max = this.getAttribute('title');
				document.getElementById(max).className = "show";
				}
			}
		}
	}
}

$(document).ready(function(){
	//$('#tabs ul li').hover(function(){$(this).css("background","#e7e6e3");});
	$('#route_tabs ul li span').first().css("background","#e7e6e3");
	$('#route_tabs ul li').bind("click", function(event){
		//$('#tabs ul li').removeClass("on").addClass("off");
		//$(this).removeClass("off").addClass("on");
		$('#route_tabs ul li span').css("background","#78726e");
		$(this).children("span").css("background","#e7e6e3");
		//alert($('#tabs ul li').attr('class'));
		//$(this).addClass("on");
	})
});
