﻿String.prototype.trim = function () {
    return this.replace(/^\s*/, "").replace(/\s*$/, "");
}

function onSearchFocus( element, defaultValue ) {
    if (element.value == defaultValue) {
        element.value = '';
    }
}

function onSearchBlur( element, defaultValue ) {
    if (element.value.trim() == '') {
        element.value = defaultValue;
    }
}

function onLocationChange(element) {
    if (element.value != undefined) {
        window.location = element.value;
    }
}

$(document).ready(function () {
    $('.mainMenuDiv a').each(function () {
        if ($(this).attr("href") == window.location.pathname || $(this).attr("href") == activeCat) {
            $(this).parent().addClass("selectedItem");
            $(this).parent().parent().parent().addClass("selectedItem");
        }
    });

});
