var current=1;
function swap(total,path,timeout)
{
setTimeout("doswap("+total+",'"+path+"',"+timeout+");",timeout);
}
function doswap(total,path,timeout)
{
current++;
if(current>total){current=1;}
document.getElementById("product").src=path+current+".jpg";
}