var imageajax = new Image();
imageajax.src="photogallery/ajaximg.gif"

var pgimgObjs = new Array(0);
var pgpictureName = null;
var pgimageFile = null;
var pgCaptionName = null;
var pgCaptionText = null;

function pgloadimage(pName,iFile,CaptionName,CaptionText)
{
pgpictureName=pName;
pgimageFile=iFile;
pgCaptionName=CaptionName;
pgCaptionText=CaptionText;

document.getElementById(pgCaptionName).innerHTML="<font class=phtcaption>" + pgCaptionText + "</font>";
document.getElementById(pgpictureName).src = imageajax.src;

pgimgObjs[0] = new Image();
pgimgObjs[0].onload = pgimgLoaded;
pgimgObjs[0].src = pgimageFile;
}

function pgimgLoaded()
{
 pgchangesandimg();
}

function pgchangesandimg()
{
	if (document.all)
  	{
		document.getElementById(pgpictureName).style.filter="blendTrans(duration=1)";
		document.getElementById(pgpictureName).filters.blendTrans.Apply();
 	}
	document.getElementById(pgpictureName).src = pgimageFile;
	if (document.all)
 	{
 		document.getElementById(pgpictureName).filters.blendTrans.Play();
	}
}