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

  //
  // CSS Linked Photo Shuffler v1.1 by
  //   Carl Camera
  //   http://iamacamera.org 
  //
  // setOpacityS06 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 gblPhotoShufflerDivIdS06 = "photodivS06";
  var gblPhotoShufflerImgIdS06 = "photoimgS06";
  var gblPhotoShufflerAnchorIdS06 = "photoanchorS06";
  var gblImgS06 = new Array(
    "images/projects/dias/0trans.gif?v=0",
    "images/projects/dias/0trans.gif?v=0",
	"images/projects/dias/prj-F02.gif?v=0",
    "images/projects/dias/prj-F03.gif?v=0",
    "images/projects/dias/prj-F04.gif?v=0",
	"images/projects/dias/prj-F01.gif?v=0"	);
  var gblHrefS06 = new Array(
	"#",   
	"#",
    "../Z-projects/04paisaje/04-prj001/prj04-001.php",
	"../Z-projects/02publicos/02-prj005/prj02-005.php",
 	"../Z-projects/04paisaje/04-prj002/prj04-002.php",
	"../Z-projects/04paisaje/04-prj001/prj04-001.php"     );
  var gblPauseSecondsS06 = 3.8;
  var gblFadeSecondsS06 = 1;
  var gblRotationsS06 = 99;

  // End Customization section
  
  var gblDeckSizeS06 = gblImgS06.length;
  var gblOpacityS06 = 100;
  var gblOnDeckS06 = 0;
  var gblStartImgS06;
  var gblStartHrefS06;
  var gblImageRotationsS06 = gblDeckSizeS06 * (gblRotationsS06+1);

 //  window.onload = photoShufflerLaunchS06;
  
  function photoShufflerLaunchS06()
  {
  	var theimgS06 = document.getElementById(gblPhotoShufflerImgIdS06);
        gblStartImgS06 = theimgS06.src; // save away to show as final image
  	var theanchorS06 = document.getElementById(gblPhotoShufflerAnchorIdS06);
        gblStartHrefS06 = theimgS06.href; // save away to show as final image

	document.getElementById(gblPhotoShufflerDivIdS06).style.backgroundImage='url(' + gblImgS06[gblOnDeckS06] + ')';
	setTimeout("photoShufflerFadeS06()",gblPauseSecondsS06*1000);
  }

  function photoShufflerFadeS06()
  {
  	var theimgS06 = document.getElementById(gblPhotoShufflerImgIdS06);
	
  	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
        var fadeDeltaS06 = 100 / (30 * gblFadeSecondsS06);

	// fade top out to reveal bottom image
	if (gblOpacityS06 < 2*fadeDeltaS06 ) 
	{
	  gblOpacityS06 = 100;
	  // stop the rotation if we're done
	  if (gblImageRotationsS06 < 1) return;
	  photoShufflerShuffleS06();
	  // pause before next fade
          setTimeout("photoShufflerFadeS06()",gblPauseSecondsS06*1000);
	}
	else
	{
	  gblOpacityS06 -= fadeDeltaS06;
	  setOpacityS06(theimgS06,gblOpacityS06);
	  setTimeout("photoShufflerFadeS06()",30);  // 1/30th of a second
	}
  }

  function photoShufflerShuffleS06()
  {
	var thedivS06 = document.getElementById(gblPhotoShufflerDivIdS06);
	var theimgS06 = document.getElementById(gblPhotoShufflerImgIdS06);
	var theanchorS06 = document.getElementById(gblPhotoShufflerAnchorIdS06);
	
	// copy div background-image to img.src
	theimgS06.src = gblImgS06[gblOnDeckS06];
	theanchorS06.href = gblHrefS06[gblOnDeckS06];
	window.status = gblHrefS06[gblOnDeckS06]; // updates status bar (optional)
	// set img opacity to 100
	setOpacityS06(theimgS06,100);

        // shuffle the deck
	gblOnDeckS06 = ++gblOnDeckS06 % gblDeckSizeS06;
	// decrement rotation counter
	if (--gblImageRotationsS06 < 1)
	{
	  // insert start/final image if we're done
	  gblImgS06[gblOnDeckS06] = gblStartImgS06;
	  gblHrefS06[gblOnDeckS06] = gblStartHrefS06;
	}

	// slide next image underneath
	thedivS06.style.backgroundImage='url(' + gblImgS06[gblOnDeckS06] + ')';
  }

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


//--><!]]>
