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

  //
  // CSS Linked Photo Shuffler v1.1 by
  //   Carl Camera
  //   http://iamacamera.org 
  //
  // setOpacityS02 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 gblPhotoShufflerDivIdS02 = "photodivS02";
  var gblPhotoShufflerImgIdS02 = "photoimgS02";
  var gblPhotoShufflerAnchorIdS02 = "photoanchorS02";
  var gblImgS02 = new Array(
	"images/projects/dias/0trans.gif?v=0",
	"images/projects/dias/0trans.gif?v=0",
	"images/projects/dias/prj-B01.gif?v=0",
	"images/projects/dias/prj-B02.gif?v=0",
	"images/projects/dias/prj-B03.gif?v=0"    );
  var gblHrefS02 = new Array(
    "#",
    "#" ,
	"../Z-projects/06concursos/06-prj009/prj06-009.php",
    "../Z-projects/06concursos/06-prj017/prj06-017.php",
	"../Z-projects/06concursos/06-prj019/prj06-019.php"   );
  var gblPauseSecondsS02 = 3.5;
  var gblFadeSecondsS02 = 1;
  var gblRotationsS02 = 99;

  // End Customization section
  
  var gblDeckSizeS02 = gblImgS02.length;
  var gblOpacityS02 = 100;
  var gblOnDeckS02 = 0;
  var gblStartImgS02;
  var gblStartHrefS02;
  var gblImageRotationsS02 = gblDeckSizeS02 * (gblRotationsS02+1);

 //  window.onload = photoShufflerLaunchS02;
  
  function photoShufflerLaunchS02()
  {
  	var theimgS02 = document.getElementById(gblPhotoShufflerImgIdS02);
        gblStartImgS02 = theimgS02.src; // save away to show as final image
  	var theanchorS02 = document.getElementById(gblPhotoShufflerAnchorIdS02);
        gblStartHrefS02 = theimgS02.href; // save away to show as final image

	document.getElementById(gblPhotoShufflerDivIdS02).style.backgroundImage='url(' + gblImgS02[gblOnDeckS02] + ')';
	setTimeout("photoShufflerFadeS02()",gblPauseSecondsS02*1000);
  }

  function photoShufflerFadeS02()
  {
  	var theimgS02 = document.getElementById(gblPhotoShufflerImgIdS02);
	
  	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
        var fadeDeltaS02 = 100 / (30 * gblFadeSecondsS02);

	// fade top out to reveal bottom image
	if (gblOpacityS02 < 2*fadeDeltaS02 ) 
	{
	  gblOpacityS02 = 100;
	  // stop the rotation if we're done
	  if (gblImageRotationsS02 < 1) return;
	  photoShufflerShuffleS02();
	  // pause before next fade
          setTimeout("photoShufflerFadeS02()",gblPauseSecondsS02*1000);
	}
	else
	{
	  gblOpacityS02 -= fadeDeltaS02;
	  setOpacityS02(theimgS02,gblOpacityS02);
	  setTimeout("photoShufflerFadeS02()",30);  // 1/30th of a second
	}
  }

  function photoShufflerShuffleS02()
  {
	var thedivS02 = document.getElementById(gblPhotoShufflerDivIdS02);
	var theimgS02 = document.getElementById(gblPhotoShufflerImgIdS02);
	var theanchorS02 = document.getElementById(gblPhotoShufflerAnchorIdS02);
	
	// copy div background-image to img.src
	theimgS02.src = gblImgS02[gblOnDeckS02];
	theanchorS02.href = gblHrefS02[gblOnDeckS02];
	window.status = gblHrefS02[gblOnDeckS02]; // updates status bar (optional)
	// set img opacity to 100
	setOpacityS02(theimgS02,100);

        // shuffle the deck
	gblOnDeckS02 = ++gblOnDeckS02 % gblDeckSizeS02;
	// decrement rotation counter
	if (--gblImageRotationsS02 < 1)
	{
	  // insert start/final image if we're done
	  gblImgS02[gblOnDeckS02] = gblStartImgS02;
	  gblHrefS02[gblOnDeckS02] = gblStartHrefS02;
	}

	// slide next image underneath
	thedivS02.style.backgroundImage='url(' + gblImgS02[gblOnDeckS02] + ')';
  }

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


//--><!]]>