﻿$(document).ready(function () {
    $("#txtSearch").focus(function () {
        if ($(this).val() === "Enter Lot Number") {
            $(this).val("");
        }
    }).blur(function () {
        if ($(this).val() === "") {
            $(this).val("Enter Lot Number");
        }
    });

    $("#menu .first").hover(
        function () {
            if (window.location.pathname.toLowerCase() != "/about-chemprotect.aspx") {
                $("#menu").css("background-image", "url(/images/menuBGFirstOver.png)");
            }
        },
        function () {
            $("#menu").css("background-image", "url(/images/menuBGFirst.png)");
        }
    );

    $("#footerWrapper").footer();

    var path = window.location.pathname.toLowerCase();
    if (path != "/" && path != "/default.aspx") {
        $("#footerSpaceManager").addClass("border");
    }

});

function showMessageBox(title, content, callback) {
    $("#divMessage").html(content).dialog({
        autoOpen: true,
        modal: true,
        title: title,
        draggable: false,
        resizable: false,
        close: function (event, ui) {
            if (callback !== undefined) {
                callback();
            }

            $(this).dialog("destroy");
        },
        buttons: {
            'Ok': function () { $(this).dialog("close"); }
        }
    });
}

function getUrlVars() {
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for (var i = 0; i < hashes.length; i++) {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

/**
*  The Footer Plugin
*  
* 	Copyright 2010 Icewares
*  
*  Licensed under the CPL (http://footer.icewares.com.br/licence.html)
*/
/**
* 	The Footer Plugin
* 
*  version 1.0.2
*  
*  Created by Stefano Stypulkowski
*   
*  Requires jQuery 1.4.x - www.jquery.com
*  
*  For instructions see:  http://footer.icewares.com.br 
*/
(function ($) { Footer = { style: { absolute: { position: "absolute", bottom: 0 }, relative: { position: "relative", bottom: "auto"} }, configs: { timeOut: 200, zIndex: 200 }, browserAdjust: 0, height: 0, fHeight: 0, fId: 0, monitor: function () { if (Footer.height !== $(document).height()) { Footer.setPosition(); Footer.height = $(document).height(); } if (Footer.fHeight !== $(Footer.fId).height()) { Footer.setFsmHeight(); Footer.footerHeight = $(Footer.fId).height(); } setTimeout(function () { Footer.monitor(); }, Footer.configs.timeOut); }, setPosition: function () { if (($(document).height() - Footer.browserAdjust) > $(window).height()) { $("#footerSpaceManager").remove(); $(Footer.fId).css(Footer.style.relative); } else { if ($("#footerSpaceManager").size() == 0) { $(Footer.fId).parent().append("<div id='footerSpaceManager' style='height: " + $(Footer.fId).height() + "px;'></div>"); } $(Footer.fId).css(Footer.style.absolute); } }, setFsmHeight: function () { if ($("#footerSpaceManager").size() > 0 && $(Footer.fId).height() !== $("#footerSpaceManager").height()) { $("#footerSpaceManager").height($(Footer.fId).height()); } } }; $.fn.footer = function (options) { Footer.configs = $.extend(Footer.configs, options); if (Footer.configs.timeOut < 1) { Footer.configs.timeOut = 1; } if ($(this).attr("id") === "") { $(this).attr("id", "footerAutoGeneratedId"); } $(this).css("z-index", Footer.configs.zIndex); Footer.fId = "#" + $(this).attr("id"); Footer.height = $(document).height(); Footer.fHeight = $(this).height(); if ($.browser.msie) { Footer.browserAdjust = 4; } Footer.setPosition(); Footer.monitor(); }; })(jQuery);
