var counter = 1;
var id;
var path;
var image;
var hLink;
var hotlink;
var total;
var prodType;
var altText;
var extention;

function makeArrayEntry(altIndex, altValue, extIndex, extValue)
{
	altText[altIndex] = altValue;
	extention[extIndex] = extValue;
}

function init(iPath, prod_id, iTotal, image_id, link_id, hreflink)
{
	image = document.getElementById(image_id);
	hLink = document.getElementById(link_id);
	
	total = iTotal;
	path = iPath;
	hotlink = hreflink;
	
	//prodType = prodTitle;
	id = prod_id;
	
	altText = new Array(iTotal);
	extention = new Array(iTotal);

}

function changePicture()
{
	//alert(path + 'medium/' + id + counter + '.' + extention[counter-1]);
	image.src = path + 'medium/' + id + counter + '.' + extention[counter-1];
	image.alt = altText[counter-1];
	hLink.href = hotlink + path + 'big/' + id + counter + '.' + extention[counter-1];
}

function nextPicture()
{
	if(counter++ >= total)
	    counter = 1;
	    
	changePicture();
}

function prevPicture()
{
	if(counter-- <= 1)
		counter = total;
		
	changePicture();
}

