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

  //
  // CSS Linked Photo Shuffler v1.1 by
  //   Carl Camera
  //   http://iamacamera.org 
  //
  // setOpacityS07 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 gblPhotoShufflerDivIdS07 = "photodivS07";
  var gblPhotoShufflerImgIdS07 = "photoimgS07";
  var gblPhotoShufflerAnchorIdS07 = "photoanchorS07";
  var gblImgS07 = new Array(
	"images/projects/dias/prj-G01.gif?v=0",
    "images/projects/dias/prj-G02.gif?v=0",
    "images/projects/dias/prj-G03.gif?v=0",
    "images/projects/dias/0trans.gif?v=0",
	"images/projects/dias/0trans.gif?v=0"    );
  var gblHrefS07 = new Array(
	"../Z-projects/02publicos/02-prj003/prj02-003.php",
	"../Z-projects/02publicos/02-prj001/prj02-001.php",
	"../Z-projects/02publicos/02-prj002/prj02-002.php",
    "#",
    "#"    );
  var gblPauseSecondsS07 = 3.6;
  var gblFadeSecondsS07 = 1;
  var gblRotationsS07 = 99;

  // End Customization section
  
  var gblDeckSizeS07 = gblImgS07.length;
  var gblOpacityS07 = 100;
  var gblOnDeckS07 = 0;
  var gblStartImgS07;
  var gblStartHrefS07;
  var gblImageRotationsS07 = gblDeckSizeS07 * (gblRotationsS07+1);

 //  window.onload = photoShufflerLaunchS07;
  
  function photoShufflerLaunchS07()
  {
  	var theimgS07 = document.getElementById(gblPhotoShufflerImgIdS07);
        gblStartImgS07 = theimgS07.src; // save away to show as final image
  	var theanchorS07 = document.getElementById(gblPhotoShufflerAnchorIdS07);
        gblStartHrefS07 = theimgS07.href; // save away to show as final image

	document.getElementById(gblPhotoShufflerDivIdS07).style.backgroundImage='url(' + gblImgS07[gblOnDeckS07] + ')';
	setTimeout("photoShufflerFadeS07()",gblPauseSecondsS07*1000);
  }

  function photoShufflerFadeS07()
  {
  	var theimgS07 = document.getElementById(gblPhotoShufflerImgIdS07);
	
  	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
        var fadeDeltaS07 = 100 / (30 * gblFadeSecondsS07);

	// fade top out to reveal bottom image
	if (gblOpacityS07 < 2*fadeDeltaS07 ) 
	{
	  gblOpacityS07 = 100;
	  // stop the rotation if we're done
	  if (gblImageRotationsS07 < 1) return;
	  photoShufflerShuffleS07();
	  // pause before next fade
          setTimeout("photoShufflerFadeS07()",gblPauseSecondsS07*1000);
	}
	else
	{
	  gblOpacityS07 -= fadeDeltaS07;
	  setOpacityS07(theimgS07,gblOpacityS07);
	  setTimeout("photoShufflerFadeS07()",30);  // 1/30th of a second
	}
  }

  function photoShufflerShuffleS07()
  {
	var thedivS07 = document.getElementById(gblPhotoShufflerDivIdS07);
	var theimgS07 = document.getElementById(gblPhotoShufflerImgIdS07);
	var theanchorS07 = document.getElementById(gblPhotoShufflerAnchorIdS07);
	
	// copy div background-image to img.src
	theimgS07.src = gblImgS07[gblOnDeckS07];
	theanchorS07.href = gblHrefS07[gblOnDeckS07];
	window.status = gblHrefS07[gblOnDeckS07]; // updates status bar (optional)
	// set img opacity to 100
	setOpacityS07(theimgS07,100);

        // shuffle the deck
	gblOnDeckS07 = ++gblOnDeckS07 % gblDeckSizeS07;
	// decrement rotation counter
	if (--gblImageRotationsS07 < 1)
	{
	  // insert start/final image if we're done
	  gblImgS07[gblOnDeckS07] = gblStartImgS07;
	  gblHrefS07[gblOnDeckS07] = gblStartHrefS07;
	}

	// slide next image underneath
	thedivS07.style.backgroundImage='url(' + gblImgS07[gblOnDeckS07] + ')';
  }

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


//--><!]]>