$(document).ready(function(){
    
    //var proj_id = '';
    $.get('funcs/fetchContent.php', function(data){
            $("#contTop").css("background-image","none");
            $("#contMid").css("background-image","none");
            $("#contBtm").css("background-image","none");
            $("#contMid").html(data);
            document.title = "Fifth Year Productions "+unescape('%AB')+" Home";
            
    });
    
       
    $(".menu_btn").hover(
    function(){
        //var path = $(this).find("img").attr("src");
        //$(this).css("backgroundImage", "url(imgs/btn_over.png)");
        $(this).addClass("btn_hover");
        
        }, function(){
           $(this).removeClass("btn_hover");
        }
    );
    
    $(".menu_btn").click(function(){
        $("#menu").find(".btn_down").removeClass("btn_down");
        $(this).addClass("btn_down");
        var btn_index = $(this).index();
        var container_height = $("#contContainer").height();
        var container_width = $("#contContainer").width();
        //alert("w:"+container_width+ " h: "+ container_height);
        $("#contMid").html($("#contMid").html()+"<div id='loading_img'><img class='unitPng' src='images/loading.png' /></div>");
        $("#loading_img").css("left",(container_width-118)/2 + 'px');
        $("#loading_img").css("top",'-25px');
        $.get('funcs/fetchContent.php?pagenum='+btn_index, function(data){
            if(btn_index == 0){
                
                $("#contTop").css("background-image","none");
                $("#contMid").css("background-image","none");
                $("#contBtm").css("background-image","none");
            }
            else
            {
                $("#contTop").css("background-image","url(images/contentBg_top.png)");
                $("#contMid").css("background-image","url(images/contentBg_mid.png)");
                $("#contBtm").css("background-image","url(images/contentBg_btm.png)");
            }
            $("#contMid").html(data);
            
        });
        switch(btn_index){
            case 0:
                document.title = "Fifth Year Productions "+unescape('%AB')+" Home";
                break;
            case 1:
                document.title = "Fifth Year Productions "+unescape('%AB')+" OurTeam";
                break;
            case 2:
                document.title = "Fifth Year Productions "+unescape('%AB')+" News";
                break;
            case 3:
                document.title = "Fifth Year Productions "+unescape('%AB')+" Contact";
                break;
            
            
        }
    });
    
    
     

    
});

  
