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

  //
  // CSS Linked Photo Shuffler v1.1 by
  //   Carl Camera
  //   http://iamacamera.org 
  //
  // setOpacityS05 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 gblPhotoShufflerDivIdS05 = "photodivS05";
  var gblPhotoShufflerImgIdS05 = "photoimgS05";
  var gblPhotoShufflerAnchorIdS05 = "photoanchorS05";
  var gblImgS05 = new Array(
 	"images/projects/dias/prj-E02.gif?v=0",
    "images/projects/dias/0trans.gif?v=0",
    "images/projects/dias/0trans.gif?v=0",
    "images/projects/dias/prj-E03.gif?v=0",
    "images/projects/dias/prj-E01.gif?v=0"     );
  var gblHrefS05 = new Array(
	 "../Z-projects/06concursos/06-prj016/prj06-016.php",
 	 "#",
	 "#",
     "../Z-projects/06concursos/06-prj010/prj06-010.php",
     "../Z-projects/06concursos/06-prj015/prj06-015.php"    );
  var gblPauseSecondsS05 = 4.5;
  var gblFadeSecondsS05 = 1;
  var gblRotationsS05 = 99;

  // End Customization section
  
  var gblDeckSizeS05 = gblImgS05.length;
  var gblOpacityS05 = 100;
  var gblOnDeckS05 = 0;
  var gblStartImgS05;
  var gblStartHrefS05;
  var gblImageRotationsS05 = gblDeckSizeS05 * (gblRotationsS05+1);

 //  window.onload = photoShufflerLaunchS05;
  
  function photoShufflerLaunchS05()
  {
  	var theimgS05 = document.getElementById(gblPhotoShufflerImgIdS05);
        gblStartImgS05 = theimgS05.src; // save away to show as final image
  	var theanchorS05 = document.getElementById(gblPhotoShufflerAnchorIdS05);
        gblStartHrefS05 = theimgS05.href; // save away to show as final image

	document.getElementById(gblPhotoShufflerDivIdS05).style.backgroundImage='url(' + gblImgS05[gblOnDeckS05] + ')';
	setTimeout("photoShufflerFadeS05()",gblPauseSecondsS05*1000);
  }

  function photoShufflerFadeS05()
  {
  	var theimgS05 = document.getElementById(gblPhotoShufflerImgIdS05);
	
  	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
        var fadeDeltaS05 = 100 / (30 * gblFadeSecondsS05);

	// fade top out to reveal bottom image
	if (gblOpacityS05 < 2*fadeDeltaS05 ) 
	{
	  gblOpacityS05 = 100;
	  // stop the rotation if we're done
	  if (gblImageRotationsS05 < 1) return;
	  photoShufflerShuffleS05();
	  // pause before next fade
          setTimeout("photoShufflerFadeS05()",gblPauseSecondsS05*1000);
	}
	else
	{
	  gblOpacityS05 -= fadeDeltaS05;
	  setOpacityS05(theimgS05,gblOpacityS05);
	  setTimeout("photoShufflerFadeS05()",30);  // 1/30th of a second
	}
  }

  function photoShufflerShuffleS05()
  {
	var thedivS05 = document.getElementById(gblPhotoShufflerDivIdS05);
	var theimgS05 = document.getElementById(gblPhotoShufflerImgIdS05);
	var theanchorS05 = document.getElementById(gblPhotoShufflerAnchorIdS05);
	
	// copy div background-image to img.src
	theimgS05.src = gblImgS05[gblOnDeckS05];
	theanchorS05.href = gblHrefS05[gblOnDeckS05];
	window.status = gblHrefS05[gblOnDeckS05]; // updates status bar (optional)
	// set img opacity to 100
	setOpacityS05(theimgS05,100);

        // shuffle the deck
	gblOnDeckS05 = ++gblOnDeckS05 % gblDeckSizeS05;
	// decrement rotation counter
	if (--gblImageRotationsS05 < 1)
	{
	  // insert start/final image if we're done
	  gblImgS05[gblOnDeckS05] = gblStartImgS05;
	  gblHrefS05[gblOnDeckS05] = gblStartHrefS05;
	}

	// slide next image underneath
	thedivS05.style.backgroundImage='url(' + gblImgS05[gblOnDeckS05] + ')';
  }

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


//--><!]]>
