function technicalTab(objItem, strStub)
{
	if ($('#technicalRow_' + strStub).css("display") == 'none')
	{
		$('#productRow_' + strStub).hide("slide", {direction: "left"}, 1000, function()
		{
			$('#technicalRow_' + strStub).show("slide", {direction: "right"}, 1000);
		});
	
		$("#productRowTabs_" + strStub).children("li").removeClass("selected");
		$(objItem.parentNode).addClass('selected');
	}
}

function productTab(objItem, strStub)
{
	if ($('#productRow_' + strStub).css('display') == 'none')
	{
		$('#technicalRow_' + strStub).hide("slide", {direction: "left"}, 1000, function()
		{
			$('#productRow_' + strStub).show("slide", {direction: "right"}, 1000);
		});
	
		$("#productRowTabs_" + strStub).children("li").removeClass("selected");
		$(objItem.parentNode).addClass('selected');
	}
}

function filterClick(objA, strValue, strFilter)
{
	$(strFilter).attr("val", strValue);
	
	$(strFilter).children("li").each(function ()
	{
		$(this).removeClass('selected');
	});
	
	$(strFilter + "All").children("li").removeClass('selected');
	
	$(objA.parentNode).addClass('selected');
	
	
	
	$(".productRowShown").hide("slide", {direction: "left"}, 1000);
	
	setTimeout("_filterProducts()", 1000);
}

function _filterProducts()
{
	var strPosition = $("#positionFilter").attr("val");
	var strBrand = $("#brandFilter").attr("val");
	var strYear = $("#yearFilter").attr("val");
	var strModel = $("#modelFilter").attr("val");
	
	if (strPosition + "" == "undefined")
	{
		strPosition = "";
	}
	
	if (strBrand + "" == "undefined")
	{
		strBrand = "";
	}
	
	if (strYear + "" == "undefined")
	{
		strYear = "";
	}
	
	if (strModel + "" == "undefined")
	{
		strModel = "";
	}
	
	$(".productRowHolder").each(function ()
	{
		if (
			(strPosition == "" || strPosition == $(this).attr('position')) &&
			(strBrand == "" || strBrand == $(this).attr('brand')) &&
			(strYear == "" || strYear == $(this).attr('years')) &&
			(strModel == "" || strModel == $(this).attr('model'))
	       )
		{
			$(this).addClass('productRowShown');
			$(this).show("slide", {direction: "right"}, 1000);
		}
		else
		{
			$(this).removeClass('productRowShown');
		}

	
	});
}

function keywordSearch()
{
	var strText = $("#quickSearch").val();
	
	if (strText != "")
	{
		document.location.href = "/products/keyword/" + encodeURIComponent(strText);
	}
	else
	{
		alert("Please enter a search keyword first");
	}
	return false;
}

