var currentImg = 0;

function switchProduct(way,productsArray,folder)
{
	numberOfProducts = productsArray.length - 1;
	
	if(way=='up')
	{
	  if(numberOfProducts!=currentImg)
	    currentImg++;
	  else
	    currentImg = 0;
	}
	
	if(way=='down')
	{
	 	if(currentImg!=0)
		  currentImg--;
		else
		  currentImg = numberOfProducts;
	}
	//alert(productsArray[currentImg]);
	document.getElementById('productContainer').style.backgroundImage = 'url(img/products/'+folder+'/'+productsArray[currentImg]+')';
}