/*
var persistmenu='yes';
var persisttype='sitewide';

function setActiveLink() {
	linksMiddleMenu=$('middleMenu').getElementsByTagName('a');
	x=String(window.location).split('/');
	currentURL=x[x.length-2]+'_'+x[x.length-1];
	for (i=0;i<linksMiddleMenu.length;i++) {
		x=String(linksMiddleMenu[i].href).split('/');
		checkingURL=x[x.length-2]+'_'+x[x.length-1];
		if (currentURL==checkingURL && !linksMiddleMenu[i].className) {
			linksMiddleMenu[i].className='active';
		}
	}
}


function initTopMenu() {
	var sfEls=document.getElementById('topMenu').getElementsByTagName('li');
	for (var i=0; i<sfEls.length; i++) {
		if (sfEls[i].className=='topmenuTitle') {
				sfEls[i].onmouseover=function() {this.className+=' topmenuTitleOver';}
				sfEls[i].onmouseout=function() {this.className=this.className.replace(new RegExp(" topmenuTitleOver\\b"), "");}
		}
	}
}

function SwitchMenu(obj) {
	if (obj && $(obj).style.display=='block') return;
	var aLinks=document.getElementById('middleMenu').getElementsByTagName('a');
	for (var i=0; i<aLinks.length; i++) {
		if (aLinks[i].className.indexOf('Open')>0) {
			aLinks[i].className=aLinks[i].className='menuTitleLink';
		}
	}
	var ar=$('middleMenu').getElementsByTagName('ul');	
	if (!obj) {
		for (var i=0; i<ar.length; i++) {
			if (ar[i].className=='subMenu') ar[i].style.display='none';
		}
		return;
	}
	
	var el=$(obj);

	if (el.style.display!='block') {
			for (var i=0; i<ar.length; i++) {
				if (ar[i].className=='subMenu') ar[i].style.display='none';
			}
			el.style.display='block';
			el.parentNode.firstChild.className='menuTitleLinkOpen';
		} else {
			el.style.display='none';
			el.parentNode.firstChild.className='menuTitleLink';
	}
}

function get_cookie(Name) { 
	var search=Name+'=';
	var returnvalue='';
	if (document.cookie.length>0) {
		offset=document.cookie.indexOf(search);
		if (offset!=-1) {
			offset+=search.length;
			end=document.cookie.indexOf(';', offset);
			if (end==-1) end=document.cookie.length;
			returnvalue=unescape(document.cookie.substring(offset, end));
		}
	}
	return returnvalue;
}

function onloadfunction() {
	initTopMenu();
	sfHover();
	
		var cookiename=(persisttype=='sitewide')?'switchmenu':window.location.pathname;
		var cookievalue=get_cookie(cookiename);
		//alert(cookievalue);
		SwitchMenu(cookievalue);
		setActiveLink();
	
}

function savemenustate() {
	var inc=1, blockid='';
	for (inc=1;inc<10;inc++) {
//	while ($('sub'+inc)) {
		if ($('sub'+inc) && $('sub'+inc).style.display=='block') {
			blockid='sub'+inc;
			break;
		}
//		inc++;
	}
	var cookiename=(persisttype=='sitewide')?'switchmenu':window.location.pathname;
	var cookievalue=(persisttype=='sitewide')?blockid+';path=/':blockid;
	document.cookie=cookiename+'='+cookievalue;
	//alert(cookievalue);
}

sfHover=function() {
	var middleMenuTitles=document.getElementById('middleMenu').getElementsByTagName('UL');	
	for (var i=0; i<middleMenuTitles.length; i++) {
		if (middleMenuTitles[i].className!='menuTitle') continue;
		middleMenuTitles[i].onmouseover=function() {
//			this.firstChild.firstChild.style.color='#FFFFFF';
//			this.firstChild.firstChild.style.backgroundImage='url(/images/middleMenu/middleMenu.title.open.bg.png)';
//			this.firstChild.firstChild.className='menuTitleLinkOpen';
//			if (this.firstChild.firstChild.nextSibling.nextSibling.id!='undefined') {
//				SwitchMenu(this.firstChild.firstChild.nextSibling.nextSibling.id);
//			}
			
		}
		middleMenuTitles[i].onmouseout=function() {
//			this.firstChild.firstChild.style.color='';
//			this.firstChild.firstChild.style.backgroundImage='';
//			this.firstChild.firstChild.className='menuTitleLink';
		}
	}
	var aLinks=document.getElementById('middleMenu').getElementsByTagName('a');
	for (var i=0; i<aLinks.length; i++) {aLinks[i].onclick=function() {this.blur();}}
}

if (persistmenu=='yes' && window.addEventListener) {
		window.addEventListener('load', onloadfunction, false);
		window.addEventListener('unload', savemenustate, false);
	} else if (persistmenu=='yes' && window.attachEvent) {
		window.attachEvent('onload', onloadfunction);
		window.attachEvent('onunload', savemenustate);
	} else if (persistmenu=='yes' && document.getElementById) {
		window.onload=onloadfunction;
		window.onunload=savemenustate;
}

//if (persistmenu=='yes' && document.getElementById) window.onunload=savemenustate;
//if (window.attachEvent) window.attachEvent("onload", sfHover);
*/