function addToWishlist(intProductID) {
	var varForm =document.getElementById('wishlist' + intProductID);	
	if (varForm) {	
			varForm.submit();
	} else {
		alert('Error: Add to Wishlist. Please contact the administrator by email at support@begiant.com');
	}

}

function CarouselView() {
	$(".products").hide();
	$(".carousel_holder").css("min-height", "500px");
	$(".carousel_holder").show();
	
	$("#ViewType").html("<a href=javascript:NormalView();>View Normal</a>")

}

function NormalView() {
	$(".carousel_holder").css("min-height", "0px");
	$(".carousel_holder").hide();
	$(".products").show();
	
	$("#ViewType").html("<a href=javascript:CarouselView();>View Carousel</a>")

}

function resetSort() {
	$("#SortOrder_SEO").val(0);
	$("#Filter_Brand").val(0);
	ApplyFilter();
}	

function ApplyFilter() {
	var sort_price = $('#SortOrder_SEO').val();
	var filter_brand = $('#Filter_Brand').val();
	
	var strURL;
	if(filter_brand != "") {
		strURL =  filter_brand
	}	
	if(sort_price != "") {
		strURL = strURL + "/" + sort_price
	}
	document.location = strURL
}

// Submits the sort form without the need for a submit button (on change).
function initSortForm(blnValidForm){
	$(".sort select").change(
		function(){
			if($(this).hasClass("SortOrder_SEO")) {
				//document.location = $(this).val();
			}
			else {
				$(this).parent().submit();
			}
		}
	);
}


$(document).ready(function(){
	//initSortForm();		// Initializes action on the Sort Forms.
});