$(document).ready(function(){
    if($("#about_the_company_container").hasClass("navigation_orange_static")){
        $("#about_the_product_container").hover(
            function () {
                $("#about_company_sub_navigation").removeClass("show_sub_navigation");
                $("#about_the_company_container").removeClass("navigation_orange_hover");
                $("#about_the_company_container").removeClass("navigation_orange_static");            
                $("#about_the_product_container").addClass("navigation_orange_hover");            
                $("#about_product_sub_navigation").addClass("show_sub_navigation");
            },
            function () {
                $("#about_product_sub_navigation").removeClass("show_sub_navigation");
                $("#about_the_company_container").addClass("navigation_orange_static");                
                $("#about_company_sub_navigation").addClass("show_sub_navigation");
                $("#about_the_product_container").removeClass("navigation_orange_hover");
            }
        )        
    }     
    if($("#about_the_product_container").hasClass("navigation_orange_static")){
        $("#about_the_company_container").hover(
            function () {
                $("#about_product_sub_navigation").removeClass("show_sub_navigation");
                $("#about_the_product_container").removeClass("navigation_orange_hover");
                $("#about_the_product_container").removeClass("navigation_orange_static");            
                $("#about_the_company_container").addClass("navigation_orange_hover");
                $("#about_company_sub_navigation").addClass("show_sub_navigation");
            },
            function () {
                $("#about_company_sub_navigation").removeClass("show_sub_navigation");
                $("#about_the_product_container").addClass("navigation_orange_static");                
                $("#about_product_sub_navigation").addClass("show_sub_navigation");
                $("#about_the_company_container").removeClass("navigation_orange_hover");
            }
        )        
    }
    if($("#about_the_product_container").hasClass("navigation_orange_static")){
        $("#home_button").hover(
            function () {
                $("#about_product_sub_navigation").removeClass("show_sub_navigation");
                $("#about_the_product_container").removeClass("navigation_orange_hover");
                $("#about_the_product_container").removeClass("navigation_orange_static");       
                $("#about_company_sub_navigation").removeClass("show_sub_navigation");
                $("#about_the_company_container").removeClass("navigation_orange_hover");
            },
            function () {
                $("#about_company_sub_navigation").removeClass("show_sub_navigation");
                $("#about_the_product_container").addClass("navigation_orange_static");                
                $("#about_product_sub_navigation").addClass("show_sub_navigation");
                $("#about_the_company_container").removeClass("navigation_orange_hover");
            }
        )        
    }  
    if($("#about_the_company_container").hasClass("navigation_orange_static")){
        $("#home_button").hover(
            function () {
                $("#about_product_sub_navigation").removeClass("show_sub_navigation");
                $("#about_the_product_container").removeClass("navigation_orange_hover");
                $("#about_the_company_container").removeClass("navigation_orange_static");       
                $("#about_company_sub_navigation").removeClass("show_sub_navigation");
                $("#about_the_company_container").removeClass("navigation_orange_hover");
            },
            function () {
                $("#about_product_sub_navigation").removeClass("show_sub_navigation");
                $("#about_the_company_container").addClass("navigation_orange_static");                
                $("#about_company_sub_navigation").addClass("show_sub_navigation");
                $("#about_the_product_container").removeClass("navigation_orange_hover");
            }
        )        
    }        
    
    $("#home_button").hover(
        function () {
            $("#about_product_sub_navigation").removeClass("show_sub_navigation");
            $("#about_the_product_container").removeClass("navigation_orange_hover");
            $("#about_company_sub_navigation").removeClass("show_sub_navigation");
            $("#about_the_company_container").removeClass("navigation_orange_hover");
        },
        function () {
            
        }
    )    
    $("#home_page_home_button").hover(
        function () {
            $("#about_product_sub_navigation").removeClass("show_sub_navigation");
            $("#about_the_product_container").removeClass("navigation_orange_hover");
            $("#about_company_sub_navigation").removeClass("show_sub_navigation");
            $("#about_the_company_container").removeClass("navigation_orange_hover");
        },
        function () {
            
        }
    )        
   $("#about_the_company_container").hover(
        function () {
            $("#about_product_sub_navigation").removeClass("show_sub_navigation");
            $("#about_the_product_container").removeClass("navigation_orange_hover");
            $("#about_the_product_container").removeClass("navigation_orange_static");            
            $("#about_the_company_container").addClass("navigation_orange_hover");
            $("#about_company_sub_navigation").addClass("show_sub_navigation");
        },
        function () {            

        }
    )
    $("#about_the_product_container").hover(
        function () {
            $("#about_company_sub_navigation").removeClass("show_sub_navigation");
            $("#about_the_company_container").removeClass("navigation_orange_hover");
            $("#about_the_company_container").removeClass("navigation_orange_static");            
            $("#about_the_product_container").addClass("navigation_orange_hover");            
            $("#about_product_sub_navigation").addClass("show_sub_navigation");
        },
        function () {
            
        }
    )
    
    $("#home_learning").mouseover(function(){
        var id = $(this).attr("id");
        $("#"+id+" .heading").css("background", "url(/images/teal_tab_rollover.png) no-repeat");
        $("#"+id+" .heading .down_arrow").css("background", "url(/images/teal_arrow_rollover.png) no-repeat");        
        $("#home_about").css("background", "url(/images/teal_box.png) no-repeat");
        $("#home_about_text").css("background", "url(/images/learning_text_rollover.png) no-repeat");
        $("#home_about_text span").html("LEARNING - Students actively engage with classic literary texts, while building vocabulary, reading-comprehension, and writing skills.");
		$("#watch_video_rollover").css("visibility", "hidden");
    })
    
    $("#home_instruction").mouseover(function(){
        var id = $(this).attr("id");
        $("#"+id+" .heading").css("background", "url(/images/pink_tab_rollover.png) no-repeat");
        $("#"+id+" .heading .down_arrow").css("background", "url(/images/pink_arrow_rollover.png) no-repeat");        
        $("#home_about").css("background", "url(/images/pink_box.png)  no-repeat");
        $("#home_about_text").css("background", "url(/images/instruction_text_rollover.png) no-repeat");
        $("#home_about_text span").html("INSTRUCTION - Teachers save class and prep time, while using formative and summative assessments to enhance and differentiate instruction.");
		$("#watch_video_rollover").css("visibility", "hidden");	
    })
    
    $("#home_assessment").mouseover(function(){
        var id = $(this).attr("id");
        $("#"+id+" .heading").css("background", "url(/images/blue_tab_rollover.png) no-repeat");
        $("#"+id+" .heading .down_arrow").css("background", "url(/images/blue_arrow_rollover.png) no-repeat");        
        $("#home_about").css("background", "url(/images/blue_box.png) no-repeat");
        $("#home_about_text").css("background", "url(/images/assessment_text_rollover.png) no-repeat");
        $("#home_about_text span").html("ASSESSMENT - Administrators gain real-time access to ongoing, quantifiable, classroom- and curriculum-based summative assessment data in three key skills areas.");
		$("#watch_video_rollover").css("visibility", "hidden");
    })        
    
    $(".home_right_common").mouseout(function(){
        var id = $(this).attr("id");
        $("#"+id+" .heading").css("background", "url(/images/three_column_heading_container.png) no-repeat");
        $("#"+id+" .heading .down_arrow").css("background", "url(/images/down_arrow.png) no-repeat");
        $("#home_about").css("background", "url(/images/home_about_container.png) no-repeat");
        $("#home_about_text").css("background", "url(/images/home_about_text.png) no-repeat");
        $("#home_about_text span").html("LEARNING - Students actively engage with classic literary texts, while building vocabulary, reading-comprehension, and writing skills.");
		$("#watch_video_rollover").css("visibility", "visible");	
    })
    
    if($("#creators_container").height() > 560){
        $("#main_content").css("height", $("#creators_container").height()+113);
        $("#content").css("height", $("#creators_container").height()+20);
    }
    
    $("#home_learning").click(function(){
        location.href = "/learning.php";
    })
    
    $("#home_instruction").click(function(){
        location.href = "/instruction.php";
    })
    
    $("#home_assessment").click(function(){
        location.href = "/assessment.php";
    })        
    
    
    $("#sign_in_form").keypress(function (e) {
        if(e.which == 13){
            $("#sign_in_form").submit();
        }
    })
    $("#sign_in_arrow").click(function(event){
        $("#sign_in_form").submit();    
    })
    

    $("#username").click(function(){
        if($(this).val() == "Username"){
            $(this).val("");
            $("#password").val("");
        }
    })
    
    $("#password").click(function(){
        if($(this).val() == "******"){            
            $(this).val("");
            $("#username").val("");
        }            
    })
    
})