
  var SlideEffect = true;

  var W3CDOM = (document.createElement && document.getElementsByTagName);
  
  var prevThis = "";
  var curThis = "";
  
  var divs = new Array();
  var slider = new Array();  
  var mouseOvers = new Array();
  var mouseOuts = new Array();  

  window.onload = init;
  function init() {
  	if (!W3CDOM) return;  	
  	
    var nav = $('leftNav');
  	var imgs = nav.getElementsByTagName('img');
  	
  	var thePageId = $('pageId').getProperty('category');
  	var theSubCategoryId = $('pageId').getProperty('subcategory');
  	
  	var theId;
  	var theOtherId;
  	var theCurrentId;
  	  	
  	for (var i=0;i<imgs.length;i++) {
  	 
      theId = imgs[i].parentNode.parentNode.id.replace('Toggle','');
      theOtherId = imgs[i].parentNode.parentNode.parentNode.id;
  	
      if( !theId.test("No") ) {
        theCurrentId = theId;   
      } else {
        theCurrentId = "";   
      }
      
      if( !theOtherId  || theOtherId == "" ){
        theOtherId = ""
      }
  	
      imgs[i].number = i; 
      
      imgs[i].onmouseover = mouseGoesOver;
      imgs[i].onmouseout = mouseGoesOut;
      
      imgs[i].pageId = thePageId;
      imgs[i].currentId = theCurrentId;
      imgs[i].otherId = theOtherId;
    
      imgs[i].subCategoryId = theSubCategoryId;
  	
      var suffix = imgs[i].src.substring(imgs[i].src.lastIndexOf('.'));
      var samePage = (window.location == imgs[i].parentNode.href);
      
      var link = imgs[i].parentNode.href.split("page=");               
              		
      mouseOuts[i] = new Image();
  		mouseOuts[i].src = imgs[i].src;  		     
      
      mouseOvers[i] = new Image();
  		mouseOvers[i].src = imgs[i].src.substring(0,imgs[i].src.lastIndexOf('.')) + "_over" + suffix;
      
      if( samePage ) {
        imgs[i].src = mouseOvers[i].src;
        mouseOuts[i].src = imgs[i].src;
      } else if ( !samePage && ( link[1] == imgs[i].subCategoryId ) ){
        imgs[i].src = mouseOvers[i].src;
        mouseOuts[i].src = imgs[i].src;
      }       
            
  	}	  	
  	
  	var idx = 0;
    $ES("div.dropdown").each(function(item){
      divs[idx] = item.id;
      slider[item.id] = new Fx.Slide(item.id,{duration: 180});
      if( item.id != thePageId ) {
        slider[item.id].hide();
      }
      idx++;
    });
    
  }  
  
  function DelayClose() {  
    if( prevThis == undefined || curThis == undefined ) { return; }
    if( prevThis.currentId != "" && prevThis.currentId != curThis.currentId ) {
      slider[prevThis.currentId].slideOut();
    }
  }
  
  function mouseGoesOver() {    

    if( (this.pageId != undefined) && (this.pageId) && (this.currentId != "") ) {                        
      if( !divs ) { return; }
      for( var i = 0; i < divs.length; i++ ) {
        if( (this.pageId != divs[i]) && (this.currentId != divs[i]) ) {
          if( slider[divs[i]] ) {        
            if( SlideEffect ) {
              slider[divs[i]].slideOut();
            } else {
              slider[divs[i]].hide();
            }
          }
        }
      }
                       
    }
        
    if( slider[this.currentId] ) {
      if( SlideEffect ) {
        slider[this.currentId].slideIn(); 
      } else {
        slider[this.currentId].show();
      }
    }    
        
    this.src = mouseOvers[this.number].src;

    return;
  }
  
  function mouseGoesOut() {
    this.src = mouseOuts[this.number].src;     
    return;
  }  	