function SetPageAsCatalogPage(){
	document.body.className = 'catalog';
}



function customizeHighSlideClose(){
	
	var elems = $$('li[class="highslide-close"]');

	if (elems.length){
		elems[0].innerHTML = '<img src="/site_images/highslide/graphics/close.png" class="highslideClose" onclick="hs.close();"/>';
	}
	
	var elems = $$('div[class="highslide-footer"]');
	
	if (elems.length){
		elems[0].innerHTML = '<img src="/site_images/highslide/graphics/previous.png" id="highslidePrevious" class="highslidePrevious" onclick="window.frames[0].getPreviousProductInfo()" /> ' +
				' <img src="/site_images/highslide/graphics/next.png" id="highslideNext" class="highslideNext" onclick="window.frames[0].getNextProductInfo()"/>';
	}
	
	var currentElementID = window.frames[0].document.getElementById("CurrentProductID").value;
	
	var previous = document.getElementById('product_'+currentElementID+'_Previous').value;
	if (!previous || previous==''){
		$('highslidePrevious').style.display = 'none';
	}
	
	var next = document.getElementById('product_'+currentElementID+'_Next').value;
	if (!next || next==''){
		$('highslideNext').style.display = 'none';
	}
}

function toggleElement(elemName){
	if ($(elemName).style.display=='none'){
		new Effect.BlindDown(elemName,{ duration: 0.3 });
	}
	else{
		new Effect.BlindUp(elemName,{ duration: 0.3 });
	}	
}

function addItemToCart(productID){
	
	params = 'ProdID='+productID;
	
	var Req = new Ajax.Request('/catalog/add_to_cart.pgm.php',
			{
				method:'post',
				parameters: params,
				onSuccess: function(xmlHttpRequest){
					var itemsInCart = 0;
					itemsInCart = parseInt(document.getElementById('cartItems').value,10);
					itemsInCart++;
					document.getElementById('itemsInCart').innerHTML = itemsInCart;
					document.getElementById('cartItems').value = itemsInCart;
				 },
				onFailure: function(xmlHttpRequest){ alert('Something went wrong... ') }
			});	
	
}

function removeFilter(filterType, filterID){
	var fields = $$('input[name="'+filterType+'[]"]');
	
	for (j=0; j< fields.length; j++){
		if (fields[j].value==filterID){
			fields[j].checked=false;
		}
	}
	document.seachForm.submit();
}

hs.graphicsDir = '/site_images/highslide/graphics/';
hs.align =  'center';
hs.outlineType = 'rounded-gold';
hs.outlineWhileAnimating = false;
hs.cacheAjax = false;
hs.enableKeyListener = false;

