var animatefind = 1;
var menuopen = 0;
var popuphidden = 1;

/*jQuery*/

//after all images load
$(window).load(function(){
    
    $("#headerbg").css({'background-color' : 'transparent'});
    $("#structure").css({'background-color' : 'transparent'});
    
});

//after HTML loads, before images
$(document).ready(function(){

    $("#slider ul").css({'margin-left' : '0'});
    
    //slider
    $("#slider").easySlider({
        auto: true, //set to false when only one banner
        continuous: true,
        numeric: true,
        numericId: 'slidenums',
        speed: 500,
        pause: 6000
    });
    
    //mouseover effects
    $("a img").not('#toplogo a img').not('#menu a img').mouseover(
        function(){$(this).stop().fadeTo("fast", 0.70)}
    );
    $("a img").not('#toplogo a img').not('#menu a img').mouseout(
        function(){$(this).stop().fadeTo("slow", 1.0)}
    );
    
    $("#cantfindit img").mouseover(
        function(){if (!menuopen) {$("#cantfindit").stop().animate({top: "173px"},"normal")}}
    );
    $("#cantfindit img").mouseout(
        function(){if (!menuopen) {$("#cantfindit").stop().animate({top: "162px"},"normal")}}
    );

    //show nav box on "Can't find it" click, hide on second click
    $("#cantfindit img").toggle(
        function(){$("#structure").animate({top: "82"},"slow");animatefind=0;menuopen=1;$("#cantfindit").stop().animate({top: "162px"},"50")},
        function(){$("#structure").animate({top: "-207"},"normal");menuopen=0
    });
    
    //hide menu when a link clicked
    $("a").click(function () {
        $("#structure").animate({top: "-207"},"fast");
    })
})