$(document).ready(function() {

    // flag js enabled
    $("body").addClass("i");

    // swap out headings for nicely anti-aliased Arial Black
    if(typeof sIFR == "function"){
        $("h1").each(function(){ $(this).addClass("forSIFR").html( '<span class="swap">'+ $(this).html().toUpperCase()+'</span>'); });
	    sIFR.replaceElement(named({sSelector:"body h1 .swap",sWmode: "transparent",sColor: "#FFFFFF",sFlashSrc:docRoot+"assets/swf/hum521.swf"}));
    };

    // dimension vars
    var minCH = 374; // minimum content height
    var fH = 91;     // height of footer menu
    var fM = 20;     // minimum footer margin

    // minimum height for content area
    if($("#content").height() < minCH) $("#content").height(minCH);

    // position footer nav
    tmH = (fH + $("#sideNav").height() + fM);
    dif = $("#contentHolder").height() - tmH;
    nfM = (dif > 0) ? dif+fM : fM;
    $("#footerNav").css({marginTop:+(nfM+4)+"px"});

    // home click
    $("#logo").mouseover(function(){ $(this).css({cursor:"pointer"}); }).click(function(){ window.location="/index.php"});

    /*
    // flash stuff
    $("#fn1").click(function(){
        cs = movie.GetVariable("thisScreen");
        ns = movie.GetVariable("numScreens");
        ms = cs -2;
        if (ms < 0) ms = ns -1;
        movie.SetVariable("thisScreen", ms );
        movie.GotoFrame(20);
        movie.Play();
        alert("back to "+ms);
    });
    $("#fn2").click(function(){
        movie.GotoFrame(20);
        movie.Play();
        alert("forwards");
    });
    */
});

function writeFlashNav() {
    //$("#flashNav").html('<ul><li id="fn1">Previous</li><li id="fn2">Next</li></ul>');
}

function showFlashNav() {
    $("#flashNav ul").css({visibility:"visible"});
}

function hideFlashNav() {
    $("#flashNav ul").css({visibility:"hidden"});
}

function swapImage() {

    isTrue = !isTrue;

    if(isTrue) {
        $(si).fadeIn();
    } else {
        $(si).fadeOut();
    }

    setTimeout('swapImage()',swapDelay);
}