function cm_doImageSwap(imgList,imgContainer,swapTime,arraySpot) {
	if (arraySpot==undefined) {
		var arraySpot=0;
		preloader(imgList);
	}
	
	var arryName = eval(imgList);
	var loadImage="<img src='"+arryName[arraySpot]+"' align='center' />";
	document.getElementById(imgContainer).innerHTML=loadImage;
	
	if(swapTime!=0) {
		arraySpot=arraySpot+1;
		if(arraySpot == arryName.length) {
			arraySpot=0;
		}
		var swapTimeSec = swapTime*1000;
		timerID = self.setTimeout('cm_doImageSwap("' + imgList + '","' + imgContainer + '",' + swapTime + ',' + arraySpot + ');', swapTimeSec);
	}
}

function preloader(imgList) {
	var newList = eval(imgList);
	var x=0;
	for (x=0; x<newList.length; x++)
	{
		pic = new Image(); 
		pic.src = newList[x];
	}
}


// Open Image Editor Application
function callImageEditor(l_id,f_id,pd_id)
{
   var theForm = document.forms.myForm;
   var prevaction = theForm.action;
   var prevtarget = theForm.target;
   
   if(!window.imageeditorwin); else window.imageeditorwin.close();
   imageeditorwin = window.open("about:blank","imageeditorwin","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=600");

   theForm.action = "imageeditor.cfm?lfield_id=" + l_id + "&ffield_id=" + f_id + "&prevdiv_id=" + pd_id;
   theForm.target = "imageeditorwin";
   theForm.submit();   
   imageeditorwin.focus();
   theForm.action = prevaction;
   theForm.target = prevtarget;
}
