document.ready(function(){
    var pages = ["forum", "home", "tour", "demo", "faqs", "application_gallery", "pricing", "complete_reference"];
    var found = false;
    $A(pages).each(function(p){
        if(location.href.match("/"+p+"/")){
            if($("nav-"+p)){
               $("nav-"+p).src = $("nav-"+p).src.replace(".gif", "_over.gif");
               found = true;
            }
        }
    });
    if(!found){
        $("nav-home").src = $("nav-home").src.replace(".gif", "_over.gif");
    }
    if($("contentWrapper")){
        $("contentWrapper").setScroll({
            x:0, y:0
        });
    }
   try{ 
    if($("banner")){
        $("banner").setScroll({
            x:0, y:232
        });
        setTimeout(function(){
            $("banner").shift({scrollTop:95, easing:"bounce", duration:1});
        }, 1000);
    }
   }catch(e){}
    
    $$(".answers").each(function(item){
        return false;
        var question = $(item.parentNode);
        item.sheight = item.getStyle('height');
        item.setStyle({overflow:'hidden', height:"0px", display:'block'});
        question.observe('click', function(){
            if(question.open){
                item.shift({height:0, duration:0.5});
                question.shift({background:'#FFFFFF', duration:0.5});
                question.open = false;
            }else{
                item.shift({height:item.sheight, duration:0.5});
                question.shift({background:'#FFFFE0', duration:0.5});
                question.open = true;
            }
        })
    });
});
var active = false;
function showContent(elem, page){
    if(active){
        active.shift({
            background:"#2E407E"
            
        });
    }else{
        $("wel").shift({
            background:"#2E407E"
            
        });
    }
    
    active = $(elem);
    active.shift({
        background:"#596bab"
    });
    
    $("contentWrapper").shift({
        scrollLeft:page*635,
        duration:1
    });
}
