     var RollIt = {
            timeout : null,
            showPopup : function(id){
                clearTimeout(this.timeout);
                if(id.style.display == 'none'){
                    this.timeout = setTimeout(function(){new Effect.Appear(id, {duration:.3, fps:40})},200);
                }
            },
            pulsePopup : function(id){
                clearTimeout(this.timeout);
                if(id.style.display == 'none'){
                    this.timeout = setTimeout(function(){new Effect.Pulsate(id, { pulses: 5, duration: 1.5})},200);
                }
            },
            hidePopup : function(id){
                if($(id).style.display == 'none'){
                    clearTimeout(this.timeout);
                }else{
                    this.timeout = setTimeout(function(){new Effect.Fade(id, {duration:.3, fps:40})},200);
                }
            }    
        }
    
    
    
    function getElementByClassName(rootobj, classname){
      var temparray=new Array()
      var inc=0
      var rootlength=rootobj.length
      alert(rootlength);
      for (i=0; i<rootlength; i++){
        if (rootobj[i].className==classname)
        temparray[inc++]=rootobj[i]
        
      }
      return temparray
    }    
    
      function loadTab(tab, tabGroup) {
        var tabGroup = document.getElementById(tabGroup);
        var tempTabs = tabGroup.getElementsByTagName('div')
        var tabs = new Array();
        var i2 = 0;
        var curTab = 0;
        for (i=0; i< tempTabs.length; i++) {
          if (tempTabs[i].className == "tab") {
          
            tabs[i2] = tempTabs[i];
            if (tabs[i2].style.display != 'none') {
              curTab = 'menu'+i2;
            }
            i2++;
          }
          
          
        }              
      /*
        if (document.getElementById(tabGroup)) {
              var tabGroup = document.getElementById(tabGroup);
              var tempTabs = tabGroup.getElementsByTagName('div')
              var tabs = new Array();
              var i2 = 0;
              var curTab = 0;
              for (i=0; i< tempTabs.length; i++) {
                if (tempTabs[i].className == "tab") {
                  tabs[i2] = tempTabs[i];
                  if (tabs[i2].style.display != 'none') {
                    curTab = i2
                  }
                  i2++;
                }
                if (curTab == tab) {
                  //if tab is not showing show last/current tab
                  if (tabs[tab].style.display == 'none') {
                    tabs[tab].style.display ='block';
                  }
                  break;
                } else {
                  if (tabs[tab]) {
                    
                    var tDiv = tabs[curTab]
                    var vDiv = tabs[tab]
                    
                    if($(tDiv).fx){$(tDiv).fx.stop();}
                    if($(vDiv).fx){$(vDiv).fx.stop();}
                    $(tDiv).fx = $(tDiv).effect('opacity', {duration: 2000}).start(0);
                    $(vDiv).fx = $(vDiv).effect('opacity', {duration: 2000}).start(1);
                  }

                
                }                
                
              }
              
        }
       */       
      }

  var timer = 250;
  var openTimer = 0;

  function timedOpen(tab, tabGroup) {
    openTimer = window.setTimeout( function() { loadTab(tab, tabGroup)}, timer );
  }
  
  function cancelOpen() {
    if(openTimer)
    	{
    		window.clearTimeout(openTimer);
    		openTimer = null;
    	}   
  }
  
  
  
 
  function toggleUnderline(tab) {
    var link = tab.getElementsByTagName("a");
    if (link[1].style.textDecoration == 'underline') {
      link[1].style.textDecoration = 'none';
    } else {
      link[1].style.textDecoration = 'underline';
    }
  }

