﻿$(document).ready(function () {
    //Container Divs for Scaling
    var mainSelector = ".content *, .panel-container *";
    //Exceptions to the scale
    var exclude = ".navigation, .navigation *, .button, .button *";
    //var exclude = "";
    $(mainSelector).not(exclude).each(function () {
        $(this).data("fsizeOrig", $(this).css("font-size"));
        $(this).data("fsizeFinc", parseFloat($(this).css("font-size")) * 1.1);
        $(this).data("fsizeSinc", parseFloat($(this).css("font-size")) * 1.3);
    });

    $(".reduce-font").click(function (event) {
        $(this).addClass("active").siblings().removeClass("active");
        $(mainSelector).each(function () {
            $(this).css("font-size", $(this).data("fsizeOrig"));
        });
        event.preventDefault();
    });

    $(".reset-font").click(function (event) {
        $(this).addClass("active").siblings().removeClass("active");
        $(mainSelector).each(function () {
            $(this).css("font-size", $(this).data("fsizeFinc"));
        });
        event.preventDefault();
    });

    $(".enlarge-font").click(function (event) {
        $(this).addClass("active").siblings().removeClass("active");
        $(mainSelector).each(function () {
            $(this).css("font-size", $(this).data("fsizeSinc"));
        });
        event.preventDefault();
    });

    $(".nav-footer-container ul li").first().addClass("first");
    var config = {
        over: function () {
                $(this).addClass('active');
                $(this).children("ul").show();
            },
        timeout: 250,
        out: function () {
                $(this).removeClass('active');
                $(this).children("ul").hide();
            }
    };
    $(".header ul li").hoverIntent(config);

    $('input[type="text"]').focus(function () {
        defaultText = $(this).val();
        $(this).val('');
    });
    $('input[type="text"]').blur(function () {
        if ($(this).val() == "") {
            $(this).val(defaultText);
        }
    });

    $('.big.large-table tr:nth-child(even)').addClass('alt-color');

    $('.printer-container').click(function (event) {
        window.print();
        event.preventDefault();
    });

    $('ul.sf_commentListing li:nth-child(even)').addClass('alt-Color')

    $('a[href$="pdf"], a[href^="http://"]').attr('target', '_blank');
    $('.large-table.big.one tr td:nth-child(1)').addClass('lib-img');
    $('.large-table.big.one tr td:nth-child(2)').addClass('lib-info');
});
