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

  //
  // CSS Linked Photo Shuffler v1.1 by
  //   Carl Camera
  //   http://iamacamera.org 
  //
  // setOpacityS08 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 gblPhotoShufflerDivIdS08 = "photodivS08";
  var gblPhotoShufflerImgIdS08 = "photoimgS08";
  var gblPhotoShufflerAnchorIdS08 = "photoanchorS08";
  var gblImgS08 = new Array(
 	"images/projects/dias/prj-H02.gif?v=0",
    "images/projects/dias/prj-H03.gif?v=0",
	"images/projects/dias/0trans.gif?v=0",
    "images/projects/dias/0trans.gif?v=0",
    "images/projects/dias/prj-H04.gif?v=0",
	"images/projects/dias/prj-H01.gif?v=0"	);
  var gblHrefS08 = new Array(
	"../Z-projects/01viviendas/01-prj013/prj01-013.php",   
	"../Z-projects/01viviendas/01-prj008/prj01-008.php",
    "#",
	"#",
 	"../Z-projects/01viviendas/01-prj004/prj01-004.php",
	"../Z-projects/01viviendas/01-prj011/prj01-011.php"     );
  var gblPauseSecondsS08 = 5.2;
  var gblFadeSecondsS08 = 1;
  var gblRotationsS08 = 99;

  // End Customization section
  
  var gblDeckSizeS08 = gblImgS08.length;
  var gblOpacityS08 = 100;
  var gblOnDeckS08 = 0;
  var gblStartImgS08;
  var gblStartHrefS08;
  var gblImageRotationsS08 = gblDeckSizeS08 * (gblRotationsS08+1);

 //  window.onload = photoShufflerLaunchS08;
  
  function photoShufflerLaunchS08()
  {
  	var theimgS08 = document.getElementById(gblPhotoShufflerImgIdS08);
        gblStartImgS08 = theimgS08.src; // save away to show as final image
  	var theanchorS08 = document.getElementById(gblPhotoShufflerAnchorIdS08);
        gblStartHrefS08 = theimgS08.href; // save away to show as final image

	document.getElementById(gblPhotoShufflerDivIdS08).style.backgroundImage='url(' + gblImgS08[gblOnDeckS08] + ')';
	setTimeout("photoShufflerFadeS08()",gblPauseSecondsS08*1000);
  }

  function photoShufflerFadeS08()
  {
  	var theimgS08 = document.getElementById(gblPhotoShufflerImgIdS08);
	
  	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
        var fadeDeltaS08 = 100 / (30 * gblFadeSecondsS08);

	// fade top out to reveal bottom image
	if (gblOpacityS08 < 2*fadeDeltaS08 ) 
	{
	  gblOpacityS08 = 100;
	  // stop the rotation if we're done
	  if (gblImageRotationsS08 < 1) return;
	  photoShufflerShuffleS08();
	  // pause before next fade
          setTimeout("photoShufflerFadeS08()",gblPauseSecondsS08*1000);
	}
	else
	{
	  gblOpacityS08 -= fadeDeltaS08;
	  setOpacityS08(theimgS08,gblOpacityS08);
	  setTimeout("photoShufflerFadeS08()",30);  // 1/30th of a second
	}
  }

  function photoShufflerShuffleS08()
  {
	var thedivS08 = document.getElementById(gblPhotoShufflerDivIdS08);
	var theimgS08 = document.getElementById(gblPhotoShufflerImgIdS08);
	var theanchorS08 = document.getElementById(gblPhotoShufflerAnchorIdS08);
	
	// copy div background-image to img.src
	theimgS08.src = gblImgS08[gblOnDeckS08];
	theanchorS08.href = gblHrefS08[gblOnDeckS08];
	window.status = gblHrefS08[gblOnDeckS08]; // updates status bar (optional)
	// set img opacity to 100
	setOpacityS08(theimgS08,100);

        // shuffle the deck
	gblOnDeckS08 = ++gblOnDeckS08 % gblDeckSizeS08;
	// decrement rotation counter
	if (--gblImageRotationsS08 < 1)
	{
	  // insert start/final image if we're done
	  gblImgS08[gblOnDeckS08] = gblStartImgS08;
	  gblHrefS08[gblOnDeckS08] = gblStartHrefS08;
	}

	// slide next image underneath
	thedivS08.style.backgroundImage='url(' + gblImgS08[gblOnDeckS08] + ')';
  }

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


//--><!]]>