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

  //
  // CSS Linked Photo Shuffler v1.1 by
  //   Carl Camera
  //   http://iamacamera.org 
  //
  // setOpacityS09 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 gblPhotoShufflerDivIdS09 = "photodivS09";
  var gblPhotoShufflerImgIdS09 = "photoimgS09";
  var gblPhotoShufflerAnchorIdS09 = "photoanchorS09";
  var gblImgS09 = new Array(
	"images/projects/dias/0trans.gif?v=0",
	"images/projects/dias/0trans.gif?v=0",
	"images/projects/dias/prj-J02.gif?v=0",
    "images/projects/dias/prj-J03.gif?v=0",
	"images/projects/dias/prj-J04.gif?v=0",
	"images/projects/dias/prj-J01.gif?v=0"   );
  var gblHrefS09 = new Array(
   	"#",
	"#",
	"../Z-projects/01viviendas/01-prj003/prj01-003.php",
    "../Z-projects/01viviendas/01-prj005/prj01-005.php",
    "../Z-projects/01viviendas/01-prj009/prj01-009.php",
    "../Z-projects/01viviendas/01-prj011/prj01-011.php" 	);
  var gblPauseSecondsS09 = 4.2;
  var gblFadeSecondsS09 = 1;
  var gblRotationsS09 = 99;

  // End Customization section
  
  var gblDeckSizeS09 = gblImgS09.length;
  var gblOpacityS09 = 100;
  var gblOnDeckS09 = 0;
  var gblStartImgS09;
  var gblStartHrefS09;
  var gblImageRotationsS09 = gblDeckSizeS09 * (gblRotationsS09+1);

 //  window.onload = photoShufflerLaunchS09;
  
  function photoShufflerLaunchS09()
  {
  	var theimgS09 = document.getElementById(gblPhotoShufflerImgIdS09);
        gblStartImgS09 = theimgS09.src; // save away to show as final image
  	var theanchorS09 = document.getElementById(gblPhotoShufflerAnchorIdS09);
        gblStartHrefS09 = theimgS09.href; // save away to show as final image

	document.getElementById(gblPhotoShufflerDivIdS09).style.backgroundImage='url(' + gblImgS09[gblOnDeckS09] + ')';
	setTimeout("photoShufflerFadeS09()",gblPauseSecondsS09*1000);
  }

  function photoShufflerFadeS09()
  {
  	var theimgS09 = document.getElementById(gblPhotoShufflerImgIdS09);
	
  	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
        var fadeDeltaS09 = 100 / (30 * gblFadeSecondsS09);

	// fade top out to reveal bottom image
	if (gblOpacityS09 < 2*fadeDeltaS09 ) 
	{
	  gblOpacityS09 = 100;
	  // stop the rotation if we're done
	  if (gblImageRotationsS09 < 1) return;
	  photoShufflerShuffleS09();
	  // pause before next fade
          setTimeout("photoShufflerFadeS09()",gblPauseSecondsS09*1000);
	}
	else
	{
	  gblOpacityS09 -= fadeDeltaS09;
	  setOpacityS09(theimgS09,gblOpacityS09);
	  setTimeout("photoShufflerFadeS09()",30);  // 1/30th of a second
	}
  }

  function photoShufflerShuffleS09()
  {
	var thedivS09 = document.getElementById(gblPhotoShufflerDivIdS09);
	var theimgS09 = document.getElementById(gblPhotoShufflerImgIdS09);
	var theanchorS09 = document.getElementById(gblPhotoShufflerAnchorIdS09);
	
	// copy div background-image to img.src
	theimgS09.src = gblImgS09[gblOnDeckS09];
	theanchorS09.href = gblHrefS09[gblOnDeckS09];
	window.status = gblHrefS09[gblOnDeckS09]; // updates status bar (optional)
	// set img opacity to 100
	setOpacityS09(theimgS09,100);

        // shuffle the deck
	gblOnDeckS09 = ++gblOnDeckS09 % gblDeckSizeS09;
	// decrement rotation counter
	if (--gblImageRotationsS09 < 1)
	{
	  // insert start/final image if we're done
	  gblImgS09[gblOnDeckS09] = gblStartImgS09;
	  gblHrefS09[gblOnDeckS09] = gblStartHrefS09;
	}

	// slide next image underneath
	thedivS09.style.backgroundImage='url(' + gblImgS09[gblOnDeckS09] + ')';
  }

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


//--><!]]>