var $j = jQuery.noConflict();


// When the document loads do everything inside here ...
$j(document).ready(function() {


    // Content Tabs
    //hide them all to start 
    $j(".boxes").addClass("hide_them");
    $j("#boxes_1").removeClass("hide_them");

    // When a link is clicked
    $j("a.tab").click(function() {
        // switch all tabs off
        $j(".active").removeClass("active");
        // switch this tab on
        $j(this).addClass("active");
        $j(this).parent().addClass("active");
        // fade all content out
        $j(".boxes").addClass("hide_them");
        $j(".boxes").removeClass("show_them");
        // fade this content in
        var boxes_show = $j(this).attr("title");
        $j("#" + boxes_show).removeClass("hide_them");
        $j("#" + boxes_show).addClass("show_them");
    });
    // end content tabs

    // Sets hover class to function in IE6
    $j('#navigation ul li').hover(function() {
        $j(this).addClass('hover');
    }, function() {
        $j(this).removeClass('hover');
    });
    // end hover classs

    $j('#nav li').hover(
		function() {
		    $j(this).children('div').css({ display: "block" });
		    $j('a', $j(this)).addClass('current');
		},
		function() {
		    $j(this).css({ background: "none" }).children('div').css({ display: "none" });
		    $j('a', $j(this)).removeClass('current');
		}
	);
		
    $j('#sitelink li').hover(
	    function() {
	        $j(this).children('ul').css({ display: "block" });
	    },
	    function() {
	        $j(this).children('ul').css({ display: "none" });
	    }
	);


    // modify diplay of boxes in ie6 - STILL BUGGY with the horizontal bar
    // $j('.boxes ul li div').css({ "border" : "1px solid red" });  { background-image: "url(../images/australia.gif)" }



    // side navigation
    $j('div#right_nav:eq(0)> div:gt(0)').hide();
    $j('div#right_nav:eq(0)> h6').click(function() {
        $j(this).next('div:hidden').slideDown('fast').siblings('div:visible').slideUp('fast');
        $j(this).addClass('current').siblings().removeClass('current');
    });
    // end side navigation


    // Home Rollovers
    // Hide all sub divs
    $j(".home_boxes").hide();

    // When a link is hovered
    $j("a.home_tab").hover(
		function() {
		    // fade all content out
		    $j(".home_boxes_start").hide();
		    $j(".home_boxes").hide();
		    // fade this content in
		    var boxes_show = $j(this).attr("title");
		    $j("#" + boxes_show).show();
		},
		function() {
		    $j(".home_boxes_start").show();
		    $j(".home_boxes").hide();
		}
	);
    // end content tabs


});



