
$(function(){
    $(".imageframe").mouseover(function(){
        $(this).parent().find(".imageframe").removeClass("focus");
        $(this).addClass("focus");
    });

    $(".top .imageframe").mouseover(function(){
        $(".top .popup_content").hide();
        var tag = $(this).attr("tag");
        $("#"+tag).show();
        // special actions
        //if(tag == "contamination"){
           $(".content .top").css({
                "background":"url('/images/"+tag+"_bg.jpg') top left no-repeat"
            });
       // }

        // clear special actions
        if(tag != "contamination") $(".top .left").css("background-image","none");
    });

    $(".bottom .imageframe").mouseover(function(){
        var tag = $(this).attr("tag");
        $(".bottom .popup_content").hide();
        $("#"+tag).show();
    });

    $(".navitem").mouseover(function(){
        var pos = $(this).position();        
        var width = $(this).width();
        $(".subnav",this).css({
            position:"absolute",width:(width+10)+"px",left:pos.left,
            top:(pos.top+24).toString()+"px"
        });
        $(".subnav",this).show();
        
    }).mouseout(function(){
        $(".subnav",this).hide();
    });

    $("#login").click(function(){
        $(".newsletter_modal").hide();
        $(".login_modal").toggle();
    });
    $("#newsletter").click(function(){
        $(".login_modal").hide();
        $(".newsletter_modal").toggle();
    });
    $(".close").click(function(){
        $(this).parent().parent().hide();
    });

});
