function go_there(frame_location)
{
 
 top.location=frame_location;

}



if (top.frames.length==0)
{
  var doc_name =  location.pathname
  document.write('<div class="footer"><span id="noframes">This page is part of a frameset. You will be redirected in 1 second so you can use the menu navigation, or click <A href = "../index.htm">here</A> to go now.</span></div>');
   setTimeout('go_there("../index.htm")',1000);
}



//store name of page in string e.g. home.htm
var pageName = window.location.href.substring(window.location.href.lastIndexOf("/") + 1);

//when page loads, find element in parent with name of document (menu-item) and assign class of selected menu-item
function theOnLoadFunction() {  
  changeParentElemClass(pageName,"MenuSelected");
  window.focus();
}

//when page unloads, find element in parent with name of document (menu-item) and assign class of normal menu-item
function theOnUnLoadFunction() {  
  changeParentElemClass(pageName,"Menu");
}


function changeParentElemClass(Elem, myClass) {
   if (parent)
   {
      var elem;
	   if(parent.document.getElementById) {
		  var elem = parent.document.getElementById(Elem);
	   } else if (parent.document.all){
		  var elem = parent.document.all[Elem];
	   }
	  if (elem)
	    elem.className = myClass;
   }            
}

window.onload=theOnLoadFunction;
window.onunload=theOnUnLoadFunction;
