﻿var ir = {};
ir.init = function (options) {
    var settings = { page: null };
    $.extend(settings, options);
    $.ajax({
        success: function (html) {
            $("#toolbar").html(html);
        },
        url: "toolbar_a01.htm"
    });
    $.ajax({
        success: function (html) {
            $("#footer").html(html);
        },
        url: "footer_a01.htm"
    });
    $("#searchForm").submit(function () { ir.search($("#searchTerm").val()); return false; });
    $("#searchTerm").val("Search our Site").addClass("watermark")
        .focus(function () {
            if ($("#searchTerm").val() == "Search our Site") {
                $("#searchTerm").val("").removeClass("watermark");
            }
        })
        .blur(function () {
            if ($("#searchTerm").val() == "") {
                $("#searchTerm").val("Search our Site").addClass("watermark");
            }
        });
};

ir.search = function (q) {
    if (q != "Search our Site") {
        window.location = "searchResults.htm?q=" + q;
    } else {
        alert("Please enter search text.");
    }
};

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-16314031-1']);
_gaq.push(['_trackPageview']);

(function () {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})(); 






