function MM_callJS(jsStr) {
  return eval(jsStr)
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

curcount=-1;
Beginslide="yes";
Firstcycle="yes";
//8 Second Increment
//timerarray=new Array(8000,16000,20000,28000);
//6 Second Increment
timerarray=new Array(6000,12000,15000,21000);
function starttrans(){
if(imgcount<=1){
return false;
}

timecount=8000;
curcount = checkimgcount(curcount,imgcount)
currentimagea=("Fades/" + Gimg[curcount]);
cycleone = setTimeout("begincycle('blenddivone','Imagefade',currentimagea,Beginslide)", timerarray[0])

curcount = checkimgcount(curcount,imgcount)
currentimageb=("Fades/" + Gimg[curcount]);
cycletwo = setTimeout("resetone('Imagefade',currentimageb)", timerarray[1])

curcount = checkimgcount(curcount,imgcount)
currentimagec=("Fades/" + Gimg[curcount]);
cyclethree = setTimeout("resettwo('blenddivone','Imagefade',currentimagec)", timerarray[2])

curcount = checkimgcount(curcount,imgcount)
currentimaged=("Fades/" + Gimg[curcount]);
cyclefour = setTimeout("resetthree('Imagefade',currentimaged)", timerarray[3])
//8 Second Increment
//timerarray=new Array(8000,16000,24000,32000);
//6 Second Increment
timerarray=new Array(6000,12000,18000,24000);
}

function begincycle(divid,imageid,curimfile,status){
    var objecttwo=findObj(divid)
	if(status!="yes"){
	objecttwo.style.backgroundImage = "url(" + curimfile + ")";
	}
	Effect.Fade(imageid, { duration:3, from:1.0, to:0.0 });
	Beginslide="no";
	clearTimeout(cycleone);
	}
function resetone(imageid,curimfile){
    var objectone=findObj(imageid)
	objectone.src = curimfile;
	Effect.Appear(imageid, { duration:3, from:0.0, to:1.0 });
	clearTimeout(cycletwo);
	}
function resettwo(divid,imageid,curimfile){
    var objecttwo=findObj(divid)
	objecttwo.style.backgroundImage = "url(" + curimfile + ")";
	Effect.Fade(imageid, { duration:3, from:1.0, to:0.0 });
	clearTimeout(cyclethree);
	}
function resetthree(imageid,curimfile,str){
    var objectthree=findObj(imageid)
	objectthree.src = curimfile;
	Effect.Appear(imageid, { duration:3, from:0.0, to:1.0 });
	clearTimeout(cyclefour);
	starttrans()
	}
function checkimgcount(curcnt,arrlen){
	var a = eval(arrlen-1);
	var b = curcnt;
	if(b>=a){
		curcnt = 0;
	}else{
		curcnt++;
	}
	return curcnt;
}
function findObj(theObj, theDoc)
{
  var p, i, foundObj;
  
  if(!theDoc) theDoc = document;
  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length)
  {
    theDoc = parent.frames[theObj.substring(p+1)].document;
    theObj = theObj.substring(0,p);
  }
  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];
  for (i=0; !foundObj && i < theDoc.forms.length; i++) 
    foundObj = theDoc.forms[i][theObj];
  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++) 
    foundObj = findObj(theObj,theDoc.layers[i].document);
  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);
  
  return foundObj;
}
