// JavaScript Document
var time = 3000;
var numofitems = 4;


function newslink(allitems,thisitem,startstate,brcolor,linkstate,textcolor){ 
   callname= "lk"+ thisitem;
   divname="sublk"+thisitem;  
  this.numberofmenuitems = allitems;
  this.caller = document.getElementById(callname);
  this.thediv = document.getElementById(divname);
 this.thediv.style.backgroundColor = startstate;
 this.thediv.style.borderColor = brcolor;
 //this.thediv.style.backgroundImage= startstate;
  this.caller.style.textDecoration = linkstate;
  this.caller.style.color = textcolor;

 
}

function changeBG(event,theobj){
  
  
   for (var i=1; i<= theobj.numberofmenuitems; i++){
    var shutdiv =eval( "link"+i+".thediv");
  	var shutlk = eval ("link"+i+".caller");
  shutdiv.style.backgroundColor="#FFFFFF";
  shutlk.style.textDecoration ="none";
  shutlk.style.color = "#666";
  shutdiv.style.borderColor ="#94b4c8";
  }
 theobj.thediv.style.backgroundColor="#FEFBF2";
 theobj.caller.style.textDecoration  = "none";
  theobj.caller.style.color = "#222";
  theobj.thediv.style.borderColor="#ffcc33";
}

function changeMG(event,theobj){
  
  
  /* for (var i=1; i<= theobj.numberofmenuitems; i++){
    var shutdiv =eval( "link"+i+".thediv");
  	var shutlk = eval ("link"+i+".caller");
  //shutdiv.style.backgroundColor="#FFFFFF";
  //shutlk.style.textDecoration ="underline";
  //shutlk.style.color = "#666";
 // shutdiv.style.borderColor ="#94b4c8";
  }*/
  //document.write(theobj.thediv.style.borderColor);
  if (theobj.thediv.style.borderColor == "rgb(148, 180, 200) rgb(148, 180, 200) rgb(148, 180, 200) rgb(148, 180, 200)" || theobj.thediv.style.borderColor == "#94b4c8" )
 {theobj.thediv.style.backgroundColor="#f6fcff";
 theobj.caller.style.textDecoration  = "underline";
 theobj.caller.style.color  = "#222";}
 // theobj.caller.style.color = "#222";
 // theobj.thediv.style.borderColor="#ffcc33";
}

function changeMO(event,theobj){
  
  
  /* for (var i=1; i<= theobj.numberofmenuitems; i++){
    var shutdiv =eval( "link"+i+".thediv");
  	var shutlk = eval ("link"+i+".caller");
  //shutdiv.style.backgroundColor="#FFFFFF";
  //shutlk.style.textDecoration ="underline";
  //shutlk.style.color = "#666";
 // shutdiv.style.borderColor ="#94b4c8";
  }*/if (theobj.thediv.style.borderColor == "rgb(148, 180, 200) rgb(148, 180, 200) rgb(148, 180, 200) rgb(148, 180, 200)" || theobj.thediv.style.borderColor == "#94b4c8")
 {theobj.thediv.style.backgroundColor="#fff";
 theobj.caller.style.textDecoration  = "none";
 theobj.caller.style.color  = "#666";}
 // theobj.caller.style.color = "#222";
 // theobj.thediv.style.borderColor="#ffcc33";
}