$(document).ready(function(){
    // Increase Font Size
    $("#increase_font").click(function(){
        var currentFontSize = $('html').css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeNum*1.1;
        $('html').css('font-size', newFontSize);
        return false;
    });
    // Decrease Font Size
    $("#decrease_font").click(function(){
        var currentFontSize = $('html').css('font-size');
        var currentFontSizeNum = parseFloat(currentFontSize, 10);
        var newFontSize = currentFontSizeNum*0.9;
        $('html').css('font-size', newFontSize);
        return false;
    });
    // Search sumbit on enter
    $("#gmTerms").keyup(function(event){
        if(event.keyCode == 13){
            $("#gmSubmit").click();
        }
    });
});

function disable_stylesheets(){
    for(i=0;i<document.styleSheets.length;i++){
        void(document.styleSheets.item(i).disabled=true);
        }
    }

// Base master search redirect
function gmQuery() {
    d1 = $('#gmTerms').val();
    window.location = '/Pages/googleSearch.aspx?q=' + d1;
    }

$(document).ready(function(){
    //browser compliant way of rendering a list of links to look inline with pipes
    $("ul.inline_links li:not(:first-child)").prepend("| ");//add pipes to inline lists

    //if empty left sidebar, hide the containers so that left sidebar doesn't look ugly
    if (!$("#zz2_QuickLaunchMenu").html()) {
        $("#PlaceHolderLeftNavBar").hide();
        $("#sidebar_extra_div1").hide();
    }

    //hide WSS Design Console if not in edit mode
    if (!$("#WSSDesignConsole table tr").html()) {
        $("#WSSDesignConsole").hide();
    }

    //made arkansas h2 into a link
    $("#arkansasgov_link").click(function(){
        window.location='http://www.arkansas.gov';
    });

    //add default value to home google search mini textbox
    $("#google_search_mini_home input.gm_searchbox").val("Search Web site").click(function(){ $(this).val(''); });

    //add default value to back google search mini textbox
    if ($("input.gsTextbox").val())
        $("#google_search_mini_back input.gm_searchbox").val($("input.gsTextbox").val());
    else
        $("#google_search_mini_back input.gm_searchbox").val("Search Web site")
        $("#google_search_mini_back input.gm_searchbox").click(function(){ $(this).val(''); });

    //add WebPartID as a class to all elements with WebpartID attribute so that we can
    //style webpart instances by their GUID which is now a class in each webpart
    $("[WebPartID]").each(function(){ $(this).addClass($(this).attr('WebPartID')); });

});

function showTodaysDate(){
    var d=new Date();
    var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
    document.write(weekday[d.getDay()] + " | ");
    document.write(d.getMonth() + 1 + ".");
    document.write(d.getDate() + ".");
    document.write(d.getFullYear());
    }
