/*if(!((document.all) && (window.ActiveXObject) && (document.selection))) { 
}
*/

window.onload = function(){
                load();
        }
function borderAdd() {
	var ml=document.getElementById('block1');
	var x=ml.getElementsByTagName('ul');
	for(i=0;i<=x.length-1;i++) {
		blist=x[i].getElementsByTagName('li')[0];
		blist.className="first";
	}
}
function load(pageName) {
	if (typeof pageName == 'undefined' ) pageName = 'default';
	switch(pageName)
	{
		case "page":
			break;
		default:
			borderAdd();
	}
}
function navPersist() {
	var accordion = document.getElementById('navigation').getElementsByTagName('*');
	var len = accordion.length;
	var loc = window.location.toString();
		if (loc.substr((loc.length-1),(loc.length)) != '/') {
			//loc += '/'
		};
	var me;
	var curHref;
	var count = 0;
	var j = 0;
	var open = -1;
	for (var i=0;i<len;i++) {
		//Sets an id on all accordion ul's, which we'll use later when we detect which accordion to  have open
		accordion[i].setAttribute('id','a' + count);
		count++
		//Highlights the actual page in the navigation
		if (accordion[i].href) {
			var accHref = accordion[i].href;
			if (accHref.substr((accHref.length-1),(accHref.length)) != '/') {accHref += '/';}
			if (accordion[i].tagName=='A' && accHref==loc && j==0) {
				curHref = accordion[i];
				me = accordion[i];
				me.setAttribute('id', 'bottomLvl');
				while(me.className !== 'parentRoll') {me = me.parentNode;}
				while (curHref.className !== 'accordion') {
					if (curHref.className == 'navigationList') {break;}
					curHref = curHref.parentNode;
				}
				me.getElementsByTagName('span')[0].className += ' menuSelect';//Sets hightlight of current parent item in main nav
				j++
			}
		}
	}
	if (curHref) {open = curHref.id.split('a')[1] || -1;}
	return parseInt(open);
}

