 <!--//--><![CDATA[//><!--

  //
  // CSS Linked Photo Shuffler v1.1 by
  //   Carl Camera
  //   http://iamacamera.org 
  //
  // setOpacityS04 Function and inpiration from Photo Fade by
  //   Richard Rutter
  //   http://clagnut.com
  //
  // License: Creative Commons Attribution 2.5  License
  //   http://creativecommons.org/licenses/by/2.5/
  //

  // Customize your photo shuffle settings
  // 
  // * Surround the target <img /> with a <div>. specify id= in both
  // * The first and final photo displayed is in the html <img> tag
  // * The array contains paths to photos you want in the rotation. 
  //   If you want the first photo in the rotation, then it's best to
  //   put it as the final array image.  All photos must be same dimension
  // * The rotations variable specifies how many times to repeat array.
  //   images. zero is a valid rotation value.

  var gblPhotoShufflerDivIdS04 = "photodivS04";
  var gblPhotoShufflerImgIdS04 = "photoimgS04";
  var gblPhotoShufflerAnchorIdS04 = "photoanchorS04";
  var gblImgS04 = new Array(
    "images/projects/dias/0trans.gif?v=0",
	"images/projects/dias/0trans.gif?v=0",
	"images/projects/dias/prj-D01.gif?v=0",
    "images/projects/dias/prj-D02.gif?v=0",
    "images/projects/dias/prj-D03.gif?v=0"
    );
  var gblHrefS04 = new Array(
	"#",
	"#",
	"../Z-projects/03interior/03-prj001/prj03-001.php",
    "../Z-projects/03interior/03-prj002/prj03-002.php",
    "../Z-projects/03interior/03-prj002/prj03-002.php"    );
  var gblPauseSecondsS04 = 8;
  var gblFadeSecondsS04 = 1;
  var gblRotationsS04 = 99;

  // End Customization section
  
  var gblDeckSizeS04 = gblImgS04.length;
  var gblOpacityS04 = 100;
  var gblOnDeckS04 = 0;
  var gblStartImgS04;
  var gblStartHrefS04;
  var gblImageRotationsS04 = gblDeckSizeS04 * (gblRotationsS04+1);

 //  window.onload = photoShufflerLaunchS04;
  
  function photoShufflerLaunchS04()
  {
  	var theimgS04 = document.getElementById(gblPhotoShufflerImgIdS04);
        gblStartImgS04 = theimgS04.src; // save away to show as final image
  	var theanchorS04 = document.getElementById(gblPhotoShufflerAnchorIdS04);
        gblStartHrefS04 = theimgS04.href; // save away to show as final image

	document.getElementById(gblPhotoShufflerDivIdS04).style.backgroundImage='url(' + gblImgS04[gblOnDeckS04] + ')';
	setTimeout("photoShufflerFadeS04()",gblPauseSecondsS04*1000);
  }

  function photoShufflerFadeS04()
  {
  	var theimgS04 = document.getElementById(gblPhotoShufflerImgIdS04);
	
  	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
        var fadeDeltaS04 = 100 / (30 * gblFadeSecondsS04);

	// fade top out to reveal bottom image
	if (gblOpacityS04 < 2*fadeDeltaS04 ) 
	{
	  gblOpacityS04 = 100;
	  // stop the rotation if we're done
	  if (gblImageRotationsS04 < 1) return;
	  photoShufflerShuffleS04();
	  // pause before next fade
          setTimeout("photoShufflerFadeS04()",gblPauseSecondsS04*1000);
	}
	else
	{
	  gblOpacityS04 -= fadeDeltaS04;
	  setOpacityS04(theimgS04,gblOpacityS04);
	  setTimeout("photoShufflerFadeS04()",30);  // 1/30th of a second
	}
  }

  function photoShufflerShuffleS04()
  {
	var thedivS04 = document.getElementById(gblPhotoShufflerDivIdS04);
	var theimgS04 = document.getElementById(gblPhotoShufflerImgIdS04);
	var theanchorS04 = document.getElementById(gblPhotoShufflerAnchorIdS04);
	
	// copy div background-image to img.src
	theimgS04.src = gblImgS04[gblOnDeckS04];
	theanchorS04.href = gblHrefS04[gblOnDeckS04];
	window.status = gblHrefS04[gblOnDeckS04]; // updates status bar (optional)
	// set img opacity to 100
	setOpacityS04(theimgS04,100);

        // shuffle the deck
	gblOnDeckS04 = ++gblOnDeckS04 % gblDeckSizeS04;
	// decrement rotation counter
	if (--gblImageRotationsS04 < 1)
	{
	  // insert start/final image if we're done
	  gblImgS04[gblOnDeckS04] = gblStartImgS04;
	  gblHrefS04[gblOnDeckS04] = gblStartHrefS04;
	}

	// slide next image underneath
	thedivS04.style.backgroundImage='url(' + gblImgS04[gblOnDeckS04] + ')';
  }

function setOpacityS04(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;

  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;

  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}


//--><!]]>