﻿/*****************************************************************/
/*  JQuery:  JavaScript class library.  To use, make sure jquery.js
/*           is included in your pages.  Then, make method calls to
/*           execute javascript code that is either in another file
/*           or also in external .js.  
/*
/*  File path: jquery.js is most likely to be located in the 
/*             includes folder...
/*****************************************************************/

/******************* VARS ***************/

/************** DOCUMENT READY ****************/
/*  All jquery must start with this function
/*  and all other functions go in side it!  
/***********************************************/
$(document).ready(function()
{
    /**************** SET CSS ON LOAD ****************/
    $("dd").not(".generic").css("display","none");//this is only in case css styles are turned off...
    
    /**************** Load function *****************/
    /**************** Close navigation drop downs if clicked *************/
    $("#bodycontainer").click(function(){
        $("dd").not(".generic").hide();
    });
    
    $("#bodyborder").click(function(){
        $("dd").not(".generic").hide();
    });
    
    $("#header").click(function(){
        $("dd").not(".generic").hide();
    });
    
    /**************** make border div a "curvy corner" *****************/
    $("#bodyborder").corner();
    
    /**************** Hover methods to "drop down" accordion ****************/
    $("dt")
        .filter("#category1").mouseout(function(){
            $(".nav1").hide(); 
        }).mouseover(function(){
                $(".nav1").show();
        })
        .end()
    
        .filter("#category2").mouseout(function(){
            $(".nav2").hide(); 
        }).mouseover(function(){
                $(".nav2").show();
        })
        .end()
    
        .filter("#category3").mouseout(function(){
            $(".nav3").hide(); 
        }).mouseover(function(){
                $(".nav3").show();
        })
        .end()
    
        .filter("#category4").mouseout(function(){
            $(".nav4").hide(); 
        }).mouseover(function(){
                $(".nav4").show();
        })
        .end()
    
        .filter("#category5").mouseout(function(){
            $(".nav5").hide(); 
        }).mouseover(function(){
                $(".nav5").show();
        })
        .end()
    
        .filter("#category6").mouseout(function(){
            $(".nav6").hide(); 
        }).mouseover(function(){
                $(".nav6").show();
        })
        .end()
    
        .filter("#category7").mouseout(function(){
            $(".nav7").hide(); 
        }).mouseover(function(){
                $(".nav7").show();
        })
        .end()
    
        .not(".generic").hover(function()
        {
            $(this).css("background-color","dimgray");
            $(this).css("color","white");
        },
        function() 
        {
            $(this).css("background-color","#DDDDDD");
            $(this).css("color","#003366");
        }) 
    .end();
    
    /**************** mouseout/mouseover functions for "dd" **************/
    $("dd")
        .filter(".nav1").mouseout(function(){
            $(".nav1").hide(); 
        }).mouseover(function(){
                $(".nav1").show();
        })
        .end()
        
        .filter(".nav2").mouseout(function(){
            $(".nav2").hide(); 
        }).mouseover(function(){
                $(".nav2").show();
        })
        .end()
    
        .filter(".nav3").mouseout(function(){
            $(".nav3").hide(); 
        }).mouseover(function(){
                $(".nav3").show();
        })
        .end()
    
        .filter(".nav4").mouseout(function(){
            $(".nav4").hide(); 
        }).mouseover(function(){
                $(".nav4").show();
        })
        .end()
    
        .filter(".nav5").mouseout(function(){
            $(".nav5").hide(); 
        }).mouseover(function(){
                $(".nav5").show();
        })
        .end()
    
        .filter(".nav6").mouseout(function(){
            $(".nav6").hide(); 
        }).mouseover(function(){
                $(".nav6").show();
        })
        .end()
    
        .filter(".nav7").mouseout(function(){
            $(".nav7").hide(); 
        }).mouseover(function(){
                $(".nav7").show();
        })
    .end();
                
});//end of ready function

/************************** REGULAR JAVASCRIPT ************************/