rotator=true; 		// needed for initialising the rotator
n=0;				// initialising the first image
direction=1;		// init direction to forward
speed=4100;			// slideshow speed in miliseconds
srcimage='myImage'; // init image name
run=0;				// init run value
counter=0			// init counter for arrays
var crossFadeDuration = 3 //init fade duration
imgObjects=new Array();
imgCaption=new Array();
imgDepot=new Array();
imgWidth=new Array();
imgHeight=new Array();
imgPhoto=new Array();

function homeshow()
{
	clearInterval(rotator)
	run = !run;

		if (run != 0)
		{
			rotator=setInterval("rotate("+direction+")",speed)
		}
		else
		{
			clearInterval(rotator)
		}
}

function rotate(direction)
{
    n=n+direction;
    if (n==counter) n=0;
    if (n==-1) n=counter-1;

   if (document.all)
   {
      document.images[srcimage].style.filter="blendTrans(duration=2)"
      document.images[srcimage].style.filter="blendTrans(duration=crossFadeDuration)"
      document.images[srcimage].filters.blendTrans.Apply()
   }
	document.images[srcimage].src=imgObjects[n].src;
    if (document.all)
    {
      document.images[srcimage].filters.blendTrans.Play()
    }
}

function showFullSize()
{
    var URL = imgDepot[n];
    newWindow = window.open(URL,"newWindow",'toolbar=no,location=no,directories=no,menubar=yes,scrollbars=yes,resizable=yes,width=600,height=400,screenx=10,screeny=10,top=10,left=10');
}

function submitOrderPrint()
{
    var shutterflyWindow;
    var bjb = "http://www.babyjellybeans.com";
    var base = "http://www.shutterfly.com/c4p/UpdateCart.jsp";
    var p1 = "?" + "addim" + "=" + "1";
    var p2 = "&" + "protocol" + "=" + "SFP,100";
    var p3 = "&" + "pid" + "=" + "C4PP";
    var p4 = "&" + "psid" + "=" + "BABY1";
    var p5 = "&" + "imnum" + "=" + "1";
    var p6 = "&" + "imraw-1" + "=" + bjb + imgDepot[n];
    var p7 = "&" + "imrawheight-1" + "=" + imgHeight[n];
    var p8 = "&" + "imrawwidth-1" + "=" + imgWidth[n];
    var p9 = "&" + "imthumb-1" + "=" + imgObjects[n].src;
    var p10 = "&" + "returl" + "=" + bjb + "/close.html";
    var URL = base + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;

    window.open(URL, shutterflyWindow,'toolbar=no,location=no,directories=no,menubar=yes,scrollbars=yes,resizable=yes,width=750,height=800,screenx=10,screeny=10,top=10,left=10');
}

