var features;  
    function swapfeatures(n,bolState){
      var targetEle=null;
        for(j=0;j<n.childNodes.length; j++){
          if(String(n.childNodes[j].className).indexOf("normal-bottom")!= -1)
            targetEle=n.childNodes[j];
        }
        
        if(targetEle!=null){
          swapState(targetEle, bolState);
        }
      }
      function swapState(n,bolState){
       
        xclass = n.className;
         if(xclass==""){
           n.className=(bolState)?n.className="active":"";
         }else{
        n.className=(bolState)?n.className+=" active":n.className.replace("active","");
         }
        
      }
      
      function remoteSwap(n,bolState, target){
        swapState(target,bolState);
      }
      function setupFeatures(){
        features = document.getElementById("features").childNodes;
        
        for(i=0;i<features.length;i++){
          switch (features[i].className){
          case 'feature':
            features[i].onmouseover=function(){
              swapfeatures(this,1);
            }
            features[i].onmouseout=function(){
              swapfeatures(this,0);
            }
            features[i].onclick=function(){
              var url = this.getElementsByTagName("a")[0].href;
              window.location.href=url;
            }
            break;
            case 'stacks':
            var stacks =  spliceDom(features[i].childNodes, 'DIV');
             for(j=0;j<stacks.length;j++){
         
            
            stacks[j].onmouseover=function(){swapState(this,1)}
            stacks[j].onmouseout=function(){swapState(this,0)}
            stacks[j].onclick=function(){
            var url = this.getElementsByTagName("a")[0].href;
            window.location.href=url
            }
          
          
        }
            break;
            case 'featuresplit':
   
               featuresplit = spliceDom(features[i].childNodes, 'DIV');
                for(k=0;k<featuresplit.length;k++){
                   
                   var moTargets=spliceDom(featuresplit[k].childNodes, "DIV");
                   for(x=0;x<moTargets.length;x++){
                    
                     if(moTargets[x].id.indexOf("top")!=-1){
                       moTargets[x].targetEle = document.getElementById(moTargets[x].id.replace("top","bottom"));
                       moTargets[x].onmouseover=function(){remoteSwap(this,1, this.targetEle)}
                       moTargets[x].onmouseout=function(){remoteSwap(this,0, this.targetEle)}
                       moTargets[x].onclick=function(){var url = this.getElementsByTagName("a")[0].href;window.location.href=url;}
                     }else{
                       moTargets[x].onmouseover=function(){swapState(this,1)}
                       moTargets[x].onmouseout=function(){swapState(this,0)}
                       moTargets[x].onclick=function(){var url = this.getElementsByTagName("a")[0].href;window.location.href=url;}
                     }
                   }
                }
            
            break;
          }
          
        }/*
       
        try{
        stacks = $('features').getElementsByClassName("stacks")[0].childNodes;     
        for(j=0;j<stacks.length;j++){
          if(stacks[j].nodeName=="DIV"){
            
            stacks[j].onmouseover=function(){swapState(this,1)}
            stacks[j].onmouseout=function(){swapState(this,0)}
            stacks[j].onclick=function(){
            var url = this.getElementsByTagName("a")[0].href;
            window.location.href=url
            }
          }
          
        }
        }catch(e){}*/
        }
        
        function spliceDom(nAr, include){
          var outAr = new Array();
          for(n=0;n<nAr.length;n++){
            if(nAr[n].nodeName==include){
              outAr.push(nAr[n]);
            }
          }
          return(outAr);
        }
      
      loadEvts.push("setupFeatures();");
