/* *********************************
           navextra.js
********************************* */

//SuckerTree Horizontal Menu (Sept 14th, 06)By Dynamic Drive: http://www.dynamicdrive.com/style/ Improved by nitro2k01 (13:37, October 13, 06)
function buildsubmenus_horizontal(){
var is_safari=(document.childNodes)&&(!document.all)&&(!navigator.taintEnabled)&&(!navigator.accentColorName)?true:false;
//var lOffset=195;
//var rOffset=25;

for (var i=0; i<menuids.length; i++){
  var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul")
    for (var t=0; t<ultags.length; t++){
    if (ultags[t].parentNode.parentNode.id==menuids[i]){ //if this is a first level submenu
      ultags[t].style.top=ultags[t].parentNode.offsetHeight+"px" //dynamically position first level submenus to be height of main menu item
      //ultags[t].style.left=ultags[t].getElementsByTagName("a")[0].offsetWidth-lOffset+"px" //offset position
      ultags[t].parentNode.getElementsByTagName("a")[0].className="mainfoldericon"
    }
    else{ //else if this is a sub level menu (ul)
      ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px" //position menu to the right of menu item that activated it
        ultags[t].parentNode.getElementsByTagName("a")[0].className="subfoldericon"
    }
    ultags[t].parentNode.onmouseover=function(e){
        this.getElementsByTagName("ul")[0].isMouseOver=true;
        this.getElementsByTagName("ul")[0].style.visibility="visible";
        if (!is_safari) {
            hideAllOther(this);
            if(this.toref) window.clearTimeout(this.toref);
        }
    }
    ultags[t].parentNode.onmouseout=function(){
        var saveref=this.getElementsByTagName("ul")[0];
      saveref.isMouseOver=false;
      if (!is_safari) {          
          if(this.toref) 
              window.clearTimeout(this.toref);          
          this.toref=window.setTimeout(function(e){ if(!saveref.isMouseOver) saveref.style.visibility="hidden" },350);
      } else {
          saveref.style.visibility="hidden"
      }    
    }
    }
  }
}


function hideAllOther(liobj){
var p=liobj.parentNode.childNodes;
var i;
try{
    for (i=0; i<p.length; i++){
        if (liobj != p[i] && "LI"==p[i].tagName && p[i].getElementsByTagName("ul").length)
            p[i].getElementsByTagName("ul")[0].style.visibility="hidden";
    }
}catch(e){
    //alert(p[i].innerHTML)
  }
}



/***********************************************
* Cross browser Marquee
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

var delayb4scroll=25000 //Specify initial delay before marquee starts to scroll on page (2000=2 seconds)
var marqueespeed=1 //Specify marquee scroll speed (larger is faster 1-10)
var pauseit=1 //Pause marquee onMousever (0=no. 1=yes)?

////NO NEED TO EDIT BELOW THIS LINE////////////

var copyspeed=marqueespeed
var pausespeed=(pauseit==0)? copyspeed: 0
var actualheight=''
var timerRunning = false;
var timer;

function scrollmarquee(){
  if(parseInt(cross_marquee.style.top)>((actualheight/2)*(-1)+8))
      cross_marquee.style.top=parseInt(cross_marquee.style.top)-copyspeed+"px"
  else
    cross_marquee.style.top=(parseInt(marqueeheight)-164)+"px"
}

function initializemarquee(){
  cross_marquee=document.getElementById("vmarquee")
  cross_marquee.style.top=0
  marqueeheight=document.getElementById("marqueecontainer").offsetHeight
  actualheight=cross_marquee.offsetHeight
  if (window.opera || navigator.userAgent.indexOf("Netscape/7")!=-1){ //if Opera or Netscape 7x, add scrollbars to scroll and exit
    cross_marquee.style.height=marqueeheight+"px"
    cross_marquee.style.overflow="scroll"
    return
  }
  setTimeout('lefttime=setInterval("scrollmarquee()",80)', delayb4scroll)
}

if (window.addEventListener)
window.addEventListener("load", initializemarquee, false)
else if (window.attachEvent)
window.attachEvent("onload", initializemarquee)
else if (document.getElementById)
window.onload=initializemarquee
  /*end marquee*/
  
  
  
/* ****************
js search box onclick events
***************** */
function swapSearchValue(field){
  if (field.value == "Search Ava..."){
    field.value = "";
    field.className = "";
  }
  else if (field.value == "") {
    field.value = "Search Ava...";
    field.className = "search";
  }
}
