// begin menubar positioning code
var section = "citizenshipCommunity"
function triggerSynch()
{
	if(top.menu.itemSelected != eval(section + '["doclick"]'))
	{
		top.menu.expand(eval(section + '["expand"]'));
		top.menu.doClick(eval(section + '["doclick"]'));
	}
	top.menu.doSubClick(eval(section + '["dosubclick"]'));
}

var offsetleft=0
var offsettop=0

var ns4=document.layers?1:0
var ie4=document.all?1:0
var ns6=document.getElementById&&!document.all?1:0

function makeStatic() {
if (ie4) {toolbar.style.pixelTop=document.body.scrollTop+offsettop}
else if (ns6) {document.getElementById("toolbar").style.top=window.pageYOffset+offsettop}
else if (ns4) {eval(document.toolbar.top=eval(window.pageYOffset+offsettop));}
setTimeout("makeStatic()",1);
}

function menu3(){
if (ns6||ie4||ns4)
makeStatic();
}
// end menubar positioning code

// begin menu control code
var theTimeOutItem = "";
var theTimeOutPointer = null;

function menuObject(id,leftoffset,topoffset)
{
	this.id = id;
	this.leftoffset = leftoffset;
	this.topoffset = topoffset;
	this.show = showMenu;
	this.hide = hideMenu;
}

function showMenu()
{
	if(ie4)
	{
		if(theTimeOutItem != "")
		{
			document.all[theTimeOutItem].style.visibility = "hidden";
		}
		document.all[this.id].style.left = toolbar.style.left + this.leftoffset;
		document.all[this.id].style.top = toolbar.style.pixelTop + this.topoffset;
		document.all[this.id].style.visibility = "visible";
	}
	if(ns6)
	{
		if(theTimeOutItem != "")
		{
			document.getElementById(theTimeOutItem).style.visibility = "hidden";
		}
		document.getElementById(this.id).style.left = document.getElementById("toolbar").style.left + this.leftoffset;
		document.getElementById(this.id).style.top = window.pageYOffset + this.topoffset;
		document.getElementById(this.id).style.visibility = "visible";
	}
	if(ns4)
	{
		if(theTimeOutItem != "")
		{
			document.layers[theTimeOutItem].visibility = "hide";
		}
		document.layers[this.id].left = document.toolbar.left + this.leftoffset;
		document.layers[this.id].top = document.toolbar.top + this.topoffset;
		document.layers[this.id].visibility = "show";
	}
}
var theTimeOutItem = "";
var theTimeOutPointer = null;
var theCloseTimeOutPointer = null;
function hideMenu()
{
	if(ie4)
	{
		theTimeOutItem = this.id;
		theCloseTimeOutPointer = setTimeout('document.all[theTimeOutItem].style.visibility = "hidden"',50);
	}
	if(ns6)
	{
		theTimeOutItem = this.id;
		theCloseTimeOutPointer = setTimeout('document.getElementById(theTimeOutItem).style.visibility = "hidden"',100);
	}
	if(ns4)
	{
		theTimeOutItem = this.id;
		theCloseTimeOutPointer = setTimeout('document.layers[theTimeOutItem].visibility = "hide"',50);
	}
}

function doMenuMouseOver(id)
{
	if(ie4)
	{
		clearTimeout(theCloseTimeOutPointer);
		document.all[id].style.visibility = "visible";
	}
	if(ns6)
	{
		clearTimeout(theCloseTimeOutPointer);
		document.getElementById(id).style.visibility = "visible";
	}
	if(ns4)
	{
		clearTimeout(theCloseTimeOutPointer);
		document.layers[id].visibility = "show";
	}
}
function doMenuMouseOut(id)
{
	if(ie4)
	{
		document.all[id].style.visibility = "hidden";
	}
	if(ns6)
	{
		document.getElementById(id).style.visibility = "hidden";
	}
	if(ns4)
	{
		document.layers[id].visibility = "hide";
	}
}

function doClick(item)
{
	if(ie4)
	{
		document.all[item].className = "mainmenuitemselected";
	}
	if(ns6)
	{
		document.getElementByID(item).className = "mainmenuitemselected";
	}
	
}

var menu_partnership = new menuObject("partnershipmenu",298,21);
var menu_policies = new menuObject("policiesmenu",228,21);
var menu_projects = new menuObject("projectsmenu",395,21)

// begin menu control code

// onload initialisation
window.onload=init;
function init()
{
	menu3();
	if(ns4)
	{
		document.partnershipmenu.onmouseover = new Function("doMenuMouseOver('partnershipmenu')");
		document.partnershipmenu.onmouseout = new Function("doMenuMouseOut('partnershipmenu')");
		document.policiesmenu.onmouseover = new Function("doMenuMouseOver('policiesmenu')");
		document.policiesmenu.onmouseout = new Function("doMenuMouseOut('policiesmenu')");
		document.projectsmenu.onmouseover = new Function("doMenuMouseOver('projectsmenu')");
		document.projectsmenu.onmouseout = new Function("doMenuMouseOut('projectsmenu')");
	}
	triggerSynch();
	
	var s = self.location.href;
	mainString = s.substring(s.lastIndexOf('\/') + 1,s.indexOf('\_'));
	//alert(mainString);
	if(mainString.indexOf('http:') == -1)
	{
		doClick(mainString);
	}
}
