// JavaScript Document
function addLoadEvent(func){
	var oldonload=window.onload;
	if(typeof window.onload!='function'){
		window.onload=func;
	}else{
		oldonload=function(){
			oldonload();
			func();
		}//end function
	}//end if
}//end addLoadEvent

function addClass(element,value){
	if(!element.className){
		element.className=value;
	}else{
		newClassName=element.className;
		newClassName+=" ";
		newClassName+=value;
		element.className=newClassName;
	}//end if
}//end addClass

function insertAfter(newElement,targetElement){
	var parent=targetElement.parentNode;
	if(parent.appendChild==targetElement){
		parent.appendChild(newElement);
	}else{
		parent.insertBefore(newElement,targetElement.nextSibling);
	}//end if
}//end insertAfter

//current_url
function highlightpage(){
	if(!document.getElementsByTagName)return false;
	if(!document.getElementById)return false;
	if(!document.getElementById("Nav"))return false;
	
	var nav=document.getElementById("Nav");
	var links=nav.getElementsByTagName("a");
	for(var i=0;i<links.length;i++){
		var linkurl=links[i].getAttribute("href");
		//linkurl=linkurl.replace("html","php");
		var currenturl=window.location.href;
		//alert(linkurl);
		//alert(currenturl);
		if(currenturl.indexOf(linkurl)!= -1){
			links[i].className="here";
		}
	}
}

addLoadEvent(highlightpage);

//AddFavorite
var address = function (obj, url, title) {
    var e = window.event || arguments.callee.caller.arguments[0];
   
    var B = {
        IE : /MSIE/.test(window.navigator.userAgent) && !window.opera
        , FF : /Firefox/.test(window.navigator.userAgent)
        , OP : !!window.opera
    };
   
    obj.onmousedown = null;
   
    if (B.IE) {
        obj.attachEvent("onmouseup", function () {
            try {
                window.external.AddFavorite(url, title);
                window.event.returnValue = false;
            } catch (exp) {}
        });
    } else {
        if (B.FF || obj.nodeName.toLowerCase() == "a") {
            obj.setAttribute("rel", "sidebar"), obj.title = title, obj.href = url;
        } else if (B.OP) {
            var a = document.createElement("a");
            a.rel = "sidebar", a.title = title, a.href = url;
            obj.parentNode.insertBefore(a, obj);
            a.appendChild(obj);
            a = null;
        }
    }
};

















