function initPage()
{
	var nav = document.getElementById("nav");
	if (nav)
	{
		var nodes = nav.getElementsByTagName("li");
		for (var i = 0; i < nodes.length; i++)
		{
			if (nodes[i].parentNode.id == "nav")
			{
				nodes[i].onmouseover = function () 
				{
					this.className += " hover";
				}
				nodes[i].onmouseout = function ()
				{
					this.className = this.className.replace(" hover", "");
				}
			}
		}
	}
}
if (window.attachEvent)
	window.attachEvent("onload", initPage);

// frame buster
if(top.frames.length != 0 || top != self) top.location.href = self.location.href;


function bookmark(url,title){
 if (window.sidebar) // firefox
	window.sidebar.addPanel(title, url, "");
 else if(window.opera && window.print){ // opera
	var elem = document.createElement('a');
	elem.setAttribute('href',url);
	elem.setAttribute('title',title);
	elem.setAttribute('rel','sidebar');
	elem.click();
 } 
 else if(document.all)// ie
	window.external.AddFavorite(url, title);
}	

// Calculate real offset values of elements
function realOffset(el, offsetType) {

 var offset = 0;

 while(el) {
  offset += el[offsetType]; 
  el = el.offsetParent;
 }

 return offset;

}
