var cur_img = "1";

function swapImg(path,id)
{
	document.swap1.src="images/"+path+"/"+id+".jpg";
	document.getElementById('swapcopy_'+cur_img).style.display = "none";
	document.getElementById('swapcopy_'+id).style.display = "block";
	document.getElementById('chiplink'+cur_img).style.background = "#fff";
	document.getElementById('chiplink'+id).style.background = "#ee529e";
	cur_img = id;
}

function nextchip(path,num)
{
	var cur_img_i = cur_img/1;
	cur_img_i++;
	if(cur_img_i < (num+1))
	{
		swapImg(path,cur_img_i);
	}else{
		swapImg(path,1);
	}
}