(function ($) {
    $(window).load(function () {
		$(".tblBrand tr:even").addClass("rowOdd");
		$("#tab-navigation a").mouseenter(function () {
			$(".tab-content").hide();
			$("#tab-navigation a").removeClass("selected");
			$(this).addClass("selected");
			$("#" + $(this).attr("id").replace("-nav", "")).show();
			$("#tab-navigation").attr("class", $(this).attr("id").replace("tab-nav-", ""));
		});
		$(".expandable-list > li").mouseenter(function () {
			if ($("a.active", this).length == 0) {
				$(".expandable-list > li a").removeClass("active");
				$("a", this).addClass("active");
				$(".expandable-list ul").slideUp("fast");
				$("ul", this).slideDown("fast");
			}
		});
		$(".TabList li li:has(ul)").each(function () {
			$("a:first-child", this).addClass("HasChildren");
		});
		$(".TabList .SelectedTab > ul").show();
		$('.jqCart').click(function (e) {
			e.preventDefault();
			var prdId = $(this).attr('id').substring($(this).attr('id').lastIndexOf("-") + 1);
			var prdQuant = $(this).closest('.product-information').children('div [id$=pnllistQUANT]').children('.product-quantities').children('.CATNormalTextBox').val();
			if (prdQuant == 'undefined' || prdQuant == null) {
				prdQuant = $(this).closest('.product-information').children('div [id$=pnlgridQUANT]').children('.product-quantities').children('.CATNormalTextBox').val();
				if (prdQuant == 'undefined' || prdQuant == null) {
					prdQuant = 1;
				};
			};
			$.post("/home/professionals/velcomm/view-cart.aspx?addtocart=p." + prdId + ",q." + prdQuant, function (data) { });
			$(this).after('<br /><b>Added to Cart</b> - <a href="/home/professionals/velcomm/view-cart.aspx">Proceed to Checkout?</a>');
		});
    });
})(jQuery);
