<!--
var HEADING=1;
var HEADINGLINK=2;
var SUBHEADING=3;
var LINK=4;
var TERTLINK=5;
var FINALARRAYELEMENT=6;
var LOGINBOX=7;
var button_delay;
var browser=navigator.appName;
var j=0;
var retrieve_count=0;
var lhcount=0;
var lhmenu=new Array(0);
var qstring_arr=new Array(0);
var forceclick="no";
var heading_link;
var subheading_link;
var highlight_subheading;
var headinglink_link;
var selected_array_pos;
var selected_pos_text;
var highlight_selected_pos;
var elmt_selected=-1;
var item_selected=-1;
var linkfound=false;
var queryfound=false;
var nav_space=177;
var iframewrite=true;
var macinitialload=false;
var strmac;
if (browser_vers=="ie5.0" || browser_vers=="op6.0") iframewrite=false;
document.write('<div id="menu2" style="z-index: 999; visibility: visible; position: absolute; left: 160px; top: 161px;"></div>');
if (iframewrite) document.write('<iframe id="DivTert" src="/cms/s.gif" scrolling="no" frameborder="0" style="position:absolute; top:0px; left:0px; display:none; z-index:997;"></iframe>');
function menuItem(type,parid,id,text,link)
{
if (type==FINALARRAYELEMENT) return;
var item=new Item(type,parid,id,text,link);
lhmenu[lhcount]=item;
if (lhmenu[lhcount].id==document.nav_form.pageid.value && linkfound==false)
{ var prim="prim";
var sec="sec";
getQueryValue(prim);
qstring_arr[0]=string_arr[i].toUpperCase();
getQueryValue(sec);
if (string_arr[i]!="not found") qstring_arr[1]=string_arr[i].toUpperCase();
var exitloop=false;
selected_array_pos=lhcount;
highlight_selected_pos=selected_array_pos;
selected_pos_text=lhmenu[highlight_selected_pos].text;
var menutype=lhmenu[lhcount].type;
if (queryfound==true)
{	if (menutype==LINK) find_secondary();
if (menutype==TERTLINK)
{	find_tertiary();
find_secondary();
}
if (menutype==HEADINGLINK) find_headinglink(menutype);
}
else no_querylink(menutype);
}
lhcount+=1;
return;
}
function find_secondary()
{
if (lhmenu[lhcount].parid==qstring_arr[0] || lhmenu[retrieve_count].type==SUBHEADING)
{ if (lhmenu[lhcount].parid==qstring_arr[0]) retrieve_count=lhcount;
for (retrieve_count=retrieve_count; retrieve_count>=0; retrieve_count--)
{ if (lhmenu[retrieve_count].type==HEADING)
{	elmt_selected=retrieve_count;
heading_link=lhmenu[retrieve_count].text;
linkfound=true;
break;
}
}
}
}
function find_tertiary()
{
if (lhmenu[lhcount].parid==qstring_arr[1])
{
for (retrieve_count=lhcount; retrieve_count>=0; retrieve_count--)
{	if (lhmenu[retrieve_count].type==SUBHEADING)
{	subheading_link=lhmenu[retrieve_count].text;
highlight_subheading=subheading_link;
break;
}
}
}
}
function find_headinglink(menutype)
{	if (menutype==HEADINGLINK && lhmenu[lhcount].parid==qstring_arr[0])
{	headinglink_link=lhmenu[lhcount].text;
linkfound=true;
}
}
function no_querylink(menutype)
{	for (retrieve_count=lhcount; retrieve_count>=0; retrieve_count--)
{
if (menutype==LINK && lhmenu[retrieve_count].type==HEADING)
{ elmt_selected=retrieve_count;
heading_link=lhmenu[retrieve_count].text;
linkfound=true;
break;
}
if (menutype==TERTLINK && lhmenu[retrieve_count].type==SUBHEADING)
{	subheading_link=lhmenu[retrieve_count].text;
highlight_subheading=subheading_link;
for (retrieve_count=retrieve_count; retrieve_count>=0; retrieve_count--)
{	if (lhmenu[retrieve_count].type==HEADING)
{	elmt_selected=retrieve_count;
heading_link=lhmenu[retrieve_count].text;
linkfound=true;
exitloop=true;
break;
}
}
if (exitloop==true) break;
}
if (menutype==HEADINGLINK && lhmenu[retrieve_count].type==HEADINGLINK)
{	headinglink_link=lhmenu[retrieve_count].text;
linkfound=true;
break;
}
}
}
function Item(type,parid,id,text,link)
{	this.type=type;
this.parid=parid;
this.id=id;
this.text=text;
this.link=link;
}
function writeVerneNav(layerName, str)
{
if (typeof getElm(layerName) == "undefined") return;
if (document.getElementById||document.all)
{
if (typeof getElm(layerName) != "undefined") getElm(layerName).innerHTML=str;
if (browser_vers=="op6.0") document.getElementById(layerName).innerHTML=str;
}
else if (document.layers)
{	getElm(layerName).document.open();
getElm(layerName).document.writeln(str);
getElm(layerName).document.close();
}
var DivMenu=document.getElementById('menu2');
if (iframewrite) var IfrMenu=document.getElementById('DivTert');
if (navigator.appName=="Netscape")
{	if (DivMenu.style.display=="none") DivMenu.style.display="block";
else if (DivMenu.style.display=="block") DivMenu.style.display="none";
}
else
{	if (document.getElementById("menu2").style.display=="none")
{	DivMenu.style.display="block";
if (iframewrite)
{	IfrMenu.style.width=DivMenu.offsetWidth;
IfrMenu.style.height=DivMenu.offsetHeight;
IfrMenu.style.top=DivMenu.style.top;
IfrMenu.style.left=DivMenu.style.left;
IfrMenu.style.zIndex=DivMenu.style.zIndex - 1;
IfrMenu.style.display="block";
}
}
else
{	DivMenu.style.display="none";
if (iframewrite) IfrMenu.style.display="none";
}
}
}
function createMenu()
{	if (browser=="Netscape")
{	nav_space=182;
str='<table width="160" cellpadding="0" cellspacing="0" height="5" valign="top" bgcolor="#FFFFFF" ><tr><td colspan="2"><img src="/cms/global/images/icons/topbar.gif" width="160" height="5" border="0" alt="Top bar"></td></tr></table>';
str+='<table width="160" cellpadding="0" cellspacing="0" height="307" valign="top" bgcolor="#666699" >';
}
else str='<table width="160" cellpadding="0" cellspacing="0" height="307" valign="top" bgcolor="#666699" >';
menulen=lhmenu.length;
str+='<tr><td valign="top"><table cellpadding="0" cellspacing="0" valign="top" border="0">';
showItems=false;
subMenu=false;
prevHeading=false;
ypos=0;
for (lhcount=0; lhcount<menulen; lhcount++)
{
if ((lhmenu[lhcount].type==HEADING) || (lhmenu[lhcount].type==HEADING && lhmenu[lhcount].text==heading_link))
{
if ((lhcount==elmt_selected) || (lhmenu[lhcount].text==heading_link))
{	arrow="d";
menulink="Close";
showItems=true;
}
else
{	arrow="r";
menulink="Open";
showItems=false;
}
submenu=false;
cssClass="menu_primary";
hreflink='<a href="javascript:void(0);" class="menu_primary_text" onClick="javascript:menu'+menulink+'('+lhcount+');return false;">';
str+='<tr class='+cssClass+' onmouseover="this.className=\'menu_primary_hover\'" onmouseout="this.className=\''+cssClass+'\'"><td width="88%">&nbsp;'+hreflink+lhmenu[lhcount].text+'</td><td width="12%">'+hreflink+'<img src="/cms/global/images/icons/'+arrow+'arrow.gif" width="20" height="24" border="0" alt="Arrow"></td></tr>';
ypos=ypos+24;
prevHeading=true;
}
else if ((lhmenu[lhcount].type==HEADINGLINK) || (lhmenu[lhcount].type==HEADINGLINK && lhmenu[lhcount].text==headinglink_link))
{
if ((lhcount==item_selected) || (lhmenu[lhcount].text==headinglink_link)) cssClass="menu_primary_hover";
else cssClass="menu_primary";
hreflink='<a href="javascript:findlink('+lhcount+')" class="menu_primary_text" onClick="linkto('+lhcount+')">';
str+='<tr class="'+cssClass+'" onmouseover="this.className=\'menu_primary_hover\'" onmouseout="this.className=\''+cssClass+'\'"><td width="88%">&nbsp;'+hreflink+lhmenu[lhcount].text+'</td></a><td width="12%">'+hreflink+'<img src="/cms/global/images/icons/rarrow.gif" width="20" height="24" border="0" alt="Arrow"></td></tr></a>';
ypos=ypos+24;
prevHeading=true;
}
if (showItems)
{	prevHeading=false;
if ((lhcount==item_selected) || (lhcount==selected_array_pos)) cssClass="menu_selected";
else cssClass = "menu_item";
if (lhmenu[lhcount].type==SUBHEADING)
{	if (lhmenu[lhcount].text==highlight_subheading) cssClass="menu_selected2";
thelink='"javascript:menuPopup('+(lhcount+1)+','+ypos+');"';
hreflink='<a href='+thelink+' class="menu_text" onMouseOver=use_timer('+thelink+');>';
str+='<tr class="'+cssClass+'" onmouseover="this.className=\'menu_item_hover\'"; onmouseout="this.className=\''+cssClass+'\';button_off();"><td width="88%">&nbsp;'+hreflink+lhmenu[lhcount].text+'</a></td><td width="12%">'+hreflink+'<img src="/cms/global/images/icons/rarrow2.gif" border="0" width="20" height="20" alt="Arrow"></a></td></tr>';
if (lhmenu[lhcount].text==subheading_link)
{	forceclick="yes";
var ypos2=ypos;
var lhstore=lhcount+1;
}
subMenu=true;
ypos=ypos+20;
}
else
{ if (lhmenu[lhcount].type==LINK && !submenu)
{	if (lhcount==highlight_selected_pos) cssClass="menu_selected2";
hreflink='<a href="javascript:findlink('+lhcount+')" class="menu_text" onClick="linkto('+lhcount+')">';
str+='<tr class="'+cssClass+'" onmouseover="this.className=\'menu_item_hover\'" onmouseout="this.className=\''+cssClass+'\'"><td width="100%" colspan="2" height="20">&nbsp;'+hreflink+lhmenu[lhcount].text+'</td></tr></a>';
ypos=ypos+20;
}
}
}
}
if (prevHeading) str+='<tr><td colspan="2"></td></tr>';
str+='<tr class="menu_primary"><td colspan="2">&nbsp;</td></tr>';
str+='</table>';
if (platform == "mac")
{
str+='</tr></table>&nbsp;\n';
strmac=str;
}
else str+='</tr></table>';
if (platform!="mac" || browser_vers!="ie5.0" || macinitialload==true)
writeVerneNav('menu',str);
if (forceclick=="yes") menuPopup(lhstore,ypos2);
selected_array_pos="";
}
function menuClose()
{	heading_link="";
subheading_link="";
selected_array_pos="";
j=0;
item_selected=-1;
elmt_selected=-1;
Clear_tert_menu(-25,0);
createMenu();
}
function menuOpen(menu_num)
{	heading_link="";
subheading_link="";
selected_array_pos="";
item_selected=-1;
elmt_selected=menu_num;
Clear_tert_menu(-25,0);
createMenu();
}
function menuPopup(menu_num,ypos)
{	forceclick="no";
if (menu_num!=j)
{	j=menu_num;
menulen=lhmenu.length;
}
if (menu_num<0 || menu_num>=menulen) str="";
else
{	str='<table id=tertiary width="160" border="0" cellpadding="0" cellspacing="0" onmouseout="close_table(event);">';
str+='<tr><td colspan="2"><img src="/cms/global/images/icons/tert_topbar.gif" width="100%" height="5" border="0" alt="Top bar"></td></tr>';
for (lhcount=menu_num; lhcount<menulen; lhcount++)
{	if (lhmenu[lhcount].type!=TERTLINK) break;
else
{	if ((lhcount==item_selected) || (lhcount==selected_array_pos)) cssClass="menu_selected";
else cssClass="menu_item";
if (lhcount == highlight_selected_pos) cssClass="menu_selected2";
hreflink='<a href="javascript:findlink('+lhcount+')" class="menu_text" onClick="popLinkto('+menu_num+','+lhcount+')";>';
str+='<tr class="'+cssClass+'" onmouseover="this.className=\'menu_item_hover\'" onmouseout="this.className=\''+cssClass+'\'"><td width="3%"><img src="/cms/global/images/icons/transparent.gif" border="0" width="6" height="20" alt=""></td><td width="97%">'+hreflink+lhmenu[lhcount].text+'</td></tr>';
}
}
str+='<tr><td colspan="2"><img src="/cms/global/images/icons/botbar.gif" width="100%" height="5  border="0" alt="Bottom bar"></td></tr>';
		if (platform=="mac") str+='</table>\n';
		else str+='</table>';
	}
	if (selected_array_pos=="")
		{	if (ypos>-1) 
			 {	 getElm("menu2").style.top=(nav_space)+(ypos);
				 document.getElementById("menu2").style.display="none"
				 writeVerneNav('menu2',str);//write out the menu
			 }
		}
	selected_array_pos="";
}
function Clear_tert_menu(menu_num,ypos)//deletes any tertiary menus currently open
{	menulen=lhmenu.length;
	str="";
	if (ypos>-1) getElm("menu2").style.top=(nav_space)+(ypos);
	writeVerneNav('menu2',str);
}
function linkto(link_num)
{	item_selected=link_num;
	cssClass="menu_selected";
}
//if the item contains a link this function is called.  If the item contains a page id use that, if not use the specified link.  We also need to build the querystring to enable our breadcrumb functionality
function findlink(lhcount)
{	var querylhnav="";
	var prim_par_id="";
	var sec_par_id="";
	var pagelink;
	
	//secondary or primary menu with a link
	if ((lhmenu[lhcount].type==LINK) || (lhmenu[lhcount].type==HEADINGLINK)) prim_par_id=lhmenu[lhcount].parid;
	
	else //we have a tertiary menu
	{	sec_par_id=lhmenu[lhcount].parid;
		//loop backwards to obtain the primary menu parent id
		for (retrieve_count=lhcount; retrieve_count>=0; retrieve_count--)
					{	if (lhmenu[retrieve_count].parid!=sec_par_id)
				  			{	prim_par_id=lhmenu[retrieve_count].parid;
				   		 		 break;
				  			}	
				 	}
	}	
	
	querylhnav="?prim="+prim_par_id.toLowerCase();

	if (lhmenu[lhcount].link!="")//if we have a page id use it
	{   pagelink=lhmenu[lhcount].link;
		window.location=pagelink;
	}
	else //we have page id
	{	pagelink=lhmenu[lhcount].id;
		
		if (sec_par_id=="")
		{	pagelink=buildVerneUrl(pagelink);
	      	pagelink+=querylhnav;
		  	window.location=pagelink;
		}
		else
		{	querylhnav=querylhnav+"&sec="+sec_par_id.toLowerCase();
		  	pagelink=buildVerneUrl(pagelink);
		 	pagelink+=querylhnav;
		  	window.location=pagelink;
		}  
	}
}
function buildVerneUrl(pageid)//build the url from the given pageid
{	var newLocation;
	if (arguments.length==1) newLocation=urlrewrite(pageid);
	
	else if (arguments.length==2) //add in content classifications and other parameters
	{   var urlextension=arguments[1];
		newLocation=urlrewrite(pageid,null,urlextension);
	}
	else if (arguments.length==3) //add in content classifications and other parameters
	{   var urlprotocol=arguments[1];
		var urlextension=arguments[2];
		newLocation=urlrewrite(pageid,urlprotocol,urlextension);
	}
	return(newLocation);
}
function popLinkto(menu_num,link_num)
{	heading_link="";
	subheading_link="";
	selected_array_pos="";
	item_selected=link_num;
}
function use_timer(thelink) //used to delay the appearance of the tertiary menu 
{	button_delay=setTimeout(thelink,500);
}
function button_off()
{	clearTimeout(button_delay);
}
function hide_table() //hides the tertiary menu
{	j=0;
	writeVerneNav('menu2',str);
}
function close_table(evnt)
{	var menucontent=document.getElementById("tertiary")

	if(document.all)
	{    if(!menucontent.contains(evnt.toElement))//IE
			setTimeout("hide_table()",300);
	}
	else
	{   if(evnt.currentTarget!= evnt.relatedTarget && !contains_ns6(menucontent, evnt.relatedTarget))//NS
			setTimeout("hide_table()",300);
	}
}
function contains_ns6(menucont, reltar)
{	while (reltar.parentNode)
	if ((reltar=reltar.parentNode)==menucont)
	return true;
	return false;	
}
function getQueryValue(fieldname)
{	querylhnav=this.location.href; //get the url string
	querylhnav=querylhnav.substring((querylhnav.indexOf('?')) + 1); //split the url so we get the query string
	string_arr=querylhnav.split('&'); //make an array of all the different name value pairs
	for (i=0; i< string_arr.length; i++) //for each pair....
		{ 	if ((string_arr[i].indexOf(fieldname)>-1) && (this.location.href.indexOf('?') > 0)) //search the string for our name
			{//split the string so we get RHS of = 
				string_arr[i]=string_arr[i].substring((string_arr[i].indexOf('=')) + 1);
				queryfound=true;
				return string_arr[i];
			}	
		}
	string_arr[i]="not found";
	return (string_arr[i]);
}
function loadHandler() {
	if (browser_family=="ns4" || browser_base=="op") {
		origHeight = this.innerHeight;
		origWidth  = this.innerWidth;
		if (browser_base=="op") { resizeHandler(); }
	}
}
function resizeHandler() {
    if (this.innerWidth != origWidth || this.innerHeight != origHeight) { location.reload(); }
    if (browser_base=="op") { setTimeout('resizeHandler()',500); }
}
      
if (browser_family=="ns4") { onresize = resizeHandler; } 
//-->
