﻿function cleartext(txt) { txt.value = ''; }
function search(qid, url) { window.location = url + '?q=' + document.getElementById(qid).value + '&page=1'; return false; }
function setCommandSupressDefault(strCommandName, strCommandValue, strConfirm) { var bConfirm; if (strConfirm != null && strConfirm != "") { bConfirm = confirm(strConfirm); } else { bConfirm = true; } if (bConfirm == true) { document.getElementById("command_name").value = strCommandName; document.getElementById("command_value").value = strCommandValue; document.getElementById("aspnetForm").submit(); } return bConfirm; }
function setCommand(strCommandName, strCommandValue, strConfirm) { var bConfirm; if (strConfirm != null && strConfirm != "") { bConfirm = confirm(strConfirm); } else { bConfirm = true; } if (bConfirm == true) { document.getElementById("command_name").value = strCommandName; document.getElementById("command_value").value = strCommandValue; } return bConfirm; }

var tabSelector = { links: null, tabs: null, init: function(linksID, tabsID) { var linksBox = document.getElementById(linksID); var tabsBox = document.getElementById(tabsID); links = linksBox.getElementsByTagName("A"); tabs = tabsBox.getElementsByTagName("DIV"); }, showTab: function(linkI, tabI) { for (i = 0; i < links.length; i++) { if (i == linkI) { links[i].className = 'on'; tabs[i].className = 'on'; } else { links[i].className = 'off'; tabs[i].className = 'off'; } } return false; } }

function submitForm(formId) {
    var objForm = document.getElementById(formId);

    if (objForm == null) { alert('There is a problem processing your order, please contact us for assistance.'); return; }

    objForm.submit();
}

$(function() {

    //  clear search box on focus if not altered.
    $(".searchbox").focus(function() {
        if ($(this).val() == "Search...") $(this).val("")
    });

    //  Create the navigation
    $("#navigation ul li").hover(
        function() {
            $(this).find("ul").show();
        },
        function() {
            $(this).find("ul").hide();
        }
    );

});

function openNewWindow(url, height, width) {

    // open a new window.
    var newWindow = window.open(url, 'open_window', 'menubar=0, toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, dependent=0, width=' + width + ', height=' + height + ', left=200, top=200')
}

