var currentPic = 1;

function getImg(id, filename, text)
{
	document.getElementById("mingleImg").src = "img/ads/gallery.jpg";
	
	newPicNum = parseInt(id);
	$("#imgText").html(text);
	$("#imgCounter").html(newPicNum);
	
	setTimeout ( "showGalleryPic('" + id + "', '" + filename + "', '" + text + "');", 2000 );
	var cacheImg = new Image();
	cacheImg.src = filename;
}

function showGalleryPic(id, filename, text)
{
	document.getElementById("mingleImg").src = filename;		
}

function nextPic(imgCount)
{
	currentPic++;
	if (currentPic > imgCount)
	{
		currentPic = 1;
	}

	showGalleryPic(currentPic, imgFile[currentPic], imgText[currentPic]);
}

