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

  //
  // CSS Linked Photo Shuffler v1.1 by
  //   Carl Camera
  //   http://iamacamera.org 
  //
  // setOpacityS01 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 gblPhotoShufflerDivIdS01 = "photodivS01";
  var gblPhotoShufflerImgIdS01 = "photoimgS01";
  var gblPhotoShufflerAnchorIdS01 = "photoanchorS01";
  var gblImgS01 = new Array(
	"images/projects/dias/prj-A02.gif?v=0",
	"images/projects/dias/0trans.gif?v=0",
	"images/projects/dias/0trans.gif?v=0",
    "images/projects/dias/prj-A03.gif?v=0",
	"images/projects/dias/prj-A04.gif?v=0",
	"images/projects/dias/prj-A01.gif?v=0"   );
  var gblHrefS01 = new Array(
   	"../Z-projects/06concursos/06-prj007/prj06-007.php",
     "#",
	 "../Z-projects/06concursos/06-prj018/prj06-018.php",// anche questo perche la immagine sottostante e' visibile in trasparenza
	"../Z-projects/06concursos/06-prj018/prj06-018.php",
    "../Z-projects/06concursos/06-prj013/prj06-013.php",
    "../Z-projects/06concursos/06-prj008/prj06-008.php" );
  var gblPauseSecondsS01 = 4;
  var gblFadeSecondsS01 = 1;
  var gblRotationsS01 = 99;

  // End Customization section
  
  var gblDeckSizeS01 = gblImgS01.length;
  var gblOpacityS01 = 100;
  var gblOnDeckS01 = 0;
  var gblStartImgS01;
  var gblStartHrefS01;
  var gblImageRotationsS01 = gblDeckSizeS01 * (gblRotationsS01+1);

 //  window.onload = photoShufflerLaunchS01;
  
  function photoShufflerLaunchS01()
  {
  	var theimgS01 = document.getElementById(gblPhotoShufflerImgIdS01);
        gblStartImgS01 = theimgS01.src; // save away to show as final image
  	var theanchorS01 = document.getElementById(gblPhotoShufflerAnchorIdS01);
        gblStartHrefS01 = theimgS01.href; // save away to show as final image

	document.getElementById(gblPhotoShufflerDivIdS01).style.backgroundImage='url(' + gblImgS01[gblOnDeckS01] + ')';
	setTimeout("photoShufflerFadeS01()",gblPauseSecondsS01*1000);
  }

  function photoShufflerFadeS01()
  {
  	var theimgS01 = document.getElementById(gblPhotoShufflerImgIdS01);
	
  	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
        var fadeDeltaS01 = 100 / (30 * gblFadeSecondsS01);

	// fade top out to reveal bottom image
	if (gblOpacityS01 < 2*fadeDeltaS01 ) 
	{
	  gblOpacityS01 = 100;
	  // stop the rotation if we're done
	  if (gblImageRotationsS01 < 1) return;
	  photoShufflerShuffleS01();
	  // pause before next fade
          setTimeout("photoShufflerFadeS01()",gblPauseSecondsS01*1000);
	}
	else
	{
	  gblOpacityS01 -= fadeDeltaS01;
	  setOpacityS01(theimgS01,gblOpacityS01);
	  setTimeout("photoShufflerFadeS01()",30);  // 1/30th of a second
	}
  }

  function photoShufflerShuffleS01()
  {
	var thedivS01 = document.getElementById(gblPhotoShufflerDivIdS01);
	var theimgS01 = document.getElementById(gblPhotoShufflerImgIdS01);
	var theanchorS01 = document.getElementById(gblPhotoShufflerAnchorIdS01);
	
	// copy div background-image to img.src
	theimgS01.src = gblImgS01[gblOnDeckS01];
	theanchorS01.href = gblHrefS01[gblOnDeckS01];
	window.status = gblHrefS01[gblOnDeckS01]; // updates status bar (optional)
	// set img opacity to 100
	setOpacityS01(theimgS01,100);

        // shuffle the deck
	gblOnDeckS01 = ++gblOnDeckS01 % gblDeckSizeS01;
	// decrement rotation counter
	if (--gblImageRotationsS01 < 1)
	{
	  // insert start/final image if we're done
	  gblImgS01[gblOnDeckS01] = gblStartImgS01;
	  gblHrefS01[gblOnDeckS01] = gblStartHrefS01;
	}

	// slide next image underneath
	thedivS01.style.backgroundImage='url(' + gblImgS01[gblOnDeckS01] + ')';
  }

function setOpacityS01(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;
}


//--><!]]>