
var curloc = window.location.href;
//alert(curloc.indexOf('cart.php'));
if(curloc.indexOf("cart.php")) {
	$(function () {
		$('body').addClass('test');
	});
}
var stringposkit = curloc.indexOf("Kitchen");
if (stringposkit > 0) {
    $(function () {
        $('body').addClass('KitchenParent');
    });
}
var stringposliv = curloc.indexOf("Living");
if (stringposliv > 0) {
    $(function () {
        $('body').addClass('LivingParent');
    });
}
var stringposfurn = curloc.indexOf("Furniture");
if (stringposfurn > 0) {
    $(function () {
        $('body').addClass('FurnitureParent');
    });
}
var stringposbathe = curloc.indexOf("Bathe");
if (stringposbathe > 0) {
    $(function () {
        $('body').addClass('BatheParent');
    });
}


var stringposnp = curloc.indexOf("New-Products");
if (stringposnp > 0) {
    $(function () {
        $('body').addClass('NPParent');
    });
}
var stringposnp = curloc.indexOf("Our-Brands");
if (stringposnp > 0) {
    $(function () {
        $('body').addClass('BrandsParent');
    });
}
$(function () {
    var searchval = $('#SearchForm input.Textbox').attr('value');
    $('#SearchForm input.Textbox').focus(function () {
        if ($(this).attr('value') == searchval) {
            $(this).val("")
        }
        $(this).removeClass('grey').addClass('black');
    });
    $('input.Textbox').blur(function () {
        $(this).removeClass('black').addClass('grey');
    });
    $('input[type="submit"]').one("focus", function () {
        $(this).addClass('black');
    });
    $('input#search_query').focus(function () {
        $(this).removeClass('grey');
        $(this).parent().parent().addClass('black');
    });
    $('input#search_query').blur(function () {
        $(this).parent().parent().removeClass('black');
        $(this).addClass('grey');
    });
    var logout = $('li.Login a').attr('href').indexOf("logout");
    if (logout < 0) {
        $('body').addClass('loggedout');
        $('li.Cart').remove();
        $('li.Login > a').click(function (e) {
            e.preventDefault();
            $('div.AccountLoginHome').toggle();
            $(this).addClass("login-open");
            $("input[type='text']:first", document.forms[0]).focus();
        });
        $("div.AccountLoginHome").mouseup(function () {
            return false
        });
        $(document).mouseup(function (e) {
            if ($(e.target).parent("li.Login a").length == 0) {
                $("li.Login > a").removeClass("login-open");
                $("div.AccountLoginHome").hide();
            }
        });
    } else {
        $('#Footer p.public').remove();
    }
    $("body.category.loggedout .BlockContent a:contains('Return')").remove();
    $('#SideCartContents .ProductList li:even').addClass('even');
    $('#OuterFooter li:last-child').addClass('last');
    $('#OuterFooter li:first-child').addClass('first');
    var currentpagelocation = $(location).attr('href');
    $('#SideAccountMenu a[href=' + currentpagelocation + ']').parent().addClass('currentpagelocation');
    $('.SidePages a[href=' + currentpagelocation + ']').parent().addClass('currentpagelocation');
    $('.SidePages a[href=' + currentpagelocation + ']').parent().addClass('currentpagelocation');
    $('#TopMenu li a[href=' + currentpagelocation + ']').parent().addClass('activepage');
    $('#TopMenu').find('li').addClass(function (index) {
        return 'nav' + index;
    });
    $('#LayoutColumn1 div#SideCategoryList').css('display', 'block');
    $('.pPrice .RetailPriceValue').remove();
    $('.SubCategoryListGrid li:eq(3)').addClass('last');
    $('.SubCategoryListGrid li:eq(8)').addClass('last');
    $('.news_item:last-child').addClass('last');
    $('.editAcc input.AccNum').attr('readonly', true).css('background-color', '#ccc').css('cursor', 'cursor');
});
