function addBookmark(title,url) {
    if (window.sidebar) {
        window.sidebar.addPanel(title, url,"");
    } else if( document.all ) {
        window.external.AddFavorite( url, title);
    } else if( window.opera && window.print ) {
        return true;
    }
}
function dropMenu(id){
	var obj = document.getElementById(id);
	var subObj = obj.getElementsByTagName("ul")[0];
	var clTime;
	obj.onmousemove = function(){if(clTime){clearTimeout(clTime);}show();}
	obj.onmouseout = function(){clTime=setTimeout(hide,200);}
	subObj.onmouseover = function(){if(clTime){clearTimeout(clTime);}}
	function show(){subObj.style.display = "block";}
	function hide(){subObj.style.display = "";}
							
}

function highlightPage(id){
	if(!document.getElementById(id)) return false;
	var nav = document.getElementById(id);
	var links = nav.getElementsByTagName('a');
	for (var i=0;i<links.length;i++){
		var linkurl =   links[i].getAttribute('href');
		var currenturl = document.location.href;
		if(currenturl.indexOf(linkurl)!=-1){
			links[i].className = 'current';
			return true;
		}
	}
}

function tabPage(obj){
	var menu = document.getElementById(obj).getElementsByTagName("a");
	var con = document.getElementById("con_"+obj).getElementsByTagName("div");
	var conArr = [];
	var m = 0;
	for(var n=0;n<con.length;n++){		
		if(con[n].className == 'opt-page'){
			conArr[m]= con[n];
			m++;
		}
	}	
	for(var i=0;i<menu.length;i++){
		menu[i].onclick = function(){
			var num = this.getAttribute("rel");
			resetTab(num);
		}	
	}
	function resetTab(current){
		for(var i=0;i<menu.length;i++){
			menu[i].className = "";	
			conArr[i].style.display = "";			
		}
		menu[current].className = "current";
		conArr[current].style.display = "block";
	}
	
}
