/***** SBCentre.ca » Small Business Centre » Developed by ScriptReaction » www.scriptreaction.com *****/

var liNav = {
	init: function(){
		liNav.divs = new Array("scr_resources");
		var x = "";
		for(var i=0; i<liNav.divs.length; i++){
			x += "#" + liNav.divs[i];
			if(i < liNav.divs.length-1){
				x += ", ";
			}
		}
		document.write("<style>"+x+"{visibility:hidden;}</style>");
	},
	launch: function (x){
		liNav.action = x; //action function id && liNav.divs array position -1;
		
		var array_ul = document.getElementsByTagName("ul");	
		for(var count_ul=0; count_ul<array_ul.length; count_ul++){
			var which_ul = array_ul[count_ul];
			if(which_ul.id == "liNav"){ //ul id condition
	
				<!-- assign li actions -->
				var array_li = which_ul.getElementsByTagName("li");
				liNav.total = 0;			
				for(var count_li=0; count_li<array_li.length; count_li++){
					liNav.total++;
					var which_li = array_li[count_li];
					which_li.id = "liNav_" + count_li;
					which_li.onclick = function(){
						liNav.ck(this.id);
						eval("liNav.doAction" + liNav.action + "('" + this.id + "')");
					}
				}
				
				<!-- assign li-a ids -->
				var total_hf = -1;
				for(var count_hf=0; count_hf<document.links.length; count_hf++){
					var which_hf = document.links[count_hf];
					if(which_hf.className == "liNav"){
						total_hf++;
						which_hf.id = "liHref_" + total_hf;
					}
				}
			}
		}
	},
	starter: function (){
		var theDiv = document.getElementById(liNav.divs[liNav.action-1]);
		theDiv.style.visibility = "visible";
		if(liNav.isOn == 0){ //no option clicked before load;
			liNav.ck("liNav_0");
		}
	},
	isOn: 0,
	ck: function (x){ //click
		if(x != liNav.isOn){
			liNav.isOn = x;
			liNav.rs();
			var array_id = x.split("_"); //x[0]='liNav', x[1]=li id;
			var theItem = document.getElementById("liHref_" + array_id[1]);
			with(theItem){
				with(style){
					backgroundColor	= "#fff";
					borderLeft 		= "5px solid #ffcc00";
					color			= "#000066";
					fontWeight 		= "bold";
					cursor 			= "default";
				}
				blur();
			}
		}
	},
	rs: function (){ //reset
		for(var i=0; i<liNav.total; i++){
			var theItem = document.getElementById("liHref_" + i);
			with(theItem.style){
				backgroundColor	= "";
				borderLeft 		= "5px solid #cdcdde";
				color			= "";
				fontWeight		= "";
				cursor 			= "";
			}
		}
	},
	
	<!-- specific click actions -->
	doAction1: function (x){
		var array_id = x.split("_");
		document.getElementById("scr_resources").scrollTop = document.getElementById("a" + array_id[1]).offsetTop;
		for(var i=1; i<10; i++){
			var subscroller = document.getElementById("subscr_" + i);
			if(subscroller != null){
				subscroller.scrollTop = 0;
			}
		}
	}
}

/********** linav init **********/
liNav.init();
global.addEvent(window, "load", liNav.starter);