var SelectElem=""; // current selected element 
var MenuElem_ID=new Array(); // menu elements ids 
var SelectElemNum=new Array(); // use for control text color 

function Initialize(){ // get iD of all td ellemnts
SelectElemNum=document.getElementById("Menu").getElementsByTagName("td");
for ( var i=1; i<=SelectElemNum.length-2; i++){ MenuElem_ID[i]= SelectElemNum[i].id;}
}
window.onload=Initialize; // If page load function Initialize calls at once

function click_td (a) 
{ 
//  checking what element was selected

if(a.id==MenuElem_ID[1]){ 
SelectElem=a.id;
parent.location="nf_index.html";
}

else
if(a.id==MenuElem_ID[2]){
SelectElem=a.id;	
parent.location="staff/nf_staff.html";
}

else
if(a.id==MenuElem_ID[3]){ 
SelectElem=a.id;	
parent.location="news/nf_news06.html";
}

else
if(a.id==MenuElem_ID[4]){
SelectElem=a.id;	
parent.location="seminars/nf_sem_2009.html";
}

else
if(a.id==MenuElem_ID[5]){
SelectElem=a.id;	
parent.location="publication/nf_pub_new.html";
}

else
if(a.id==MenuElem_ID[6]){
SelectElem=a.id;	
parent.location="foreword/nf_index.html";
}

else
if(a.id==MenuElem_ID[7]){
SelectElem=a.id;	
parent.location="beamlines/nf_beamlines.htm";
}

else
if(a.id==MenuElem_ID[8]){
SelectElem=a.id;	
parent.location="nf_science.htm";
}

else
if(a.id==MenuElem_ID[9]){
SelectElem=a.id;	
parent.location="nf_Under_construct.html";
}

else
if(a.id==MenuElem_ID[10]){
SelectElem=a.id;	
parent.location="nf_Under_construct.html";
}

else
if(a.id==MenuElem_ID[11]){
SelectElem=a.id;	
parent.location="petition/nf_index.html";
}

else
if(a.id==MenuElem_ID[12]){
SelectElem=a.id;	
parent.location="nf_pressrel.htm";
}

else
if(a.id==MenuElem_ID[13]){
SelectElem=a.id;	
parent.location="nf_links.htm";
}

else { alert(" Page Error ") }
}

function f(a){
a.style.backgroundColor="#0000E6";
if(a.id!=SelectElem ){ // check what element has being used currently 
a.getElementsByTagName("font")[0].getElementsByTagName("a")[0].style.color="white";
}
}
function f2(a){
a.style.backgroundColor="";
if(a.id!=SelectElem ){
a.getElementsByTagName("font")[0].getElementsByTagName("a")[0].style.color="#0000E6";
	}
}

function write(to, where, subj)
{
       var letter = "mail" + "to:" + to + "@" + where + "?subject=" + subj
       location = letter
  }


