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

  //
  // CSS Linked Photo Shuffler v1.1 by
  //   Carl Camera
  //   http://iamacamera.org 
  //
  // setOpacityS10 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 gblPhotoShufflerDivIdS10 = "photodivS10";
  var gblPhotoShufflerImgIdS10 = "photoimgS10";
  var gblPhotoShufflerAnchorIdS10 = "photoanchorS10";
  var gblImgS10 = new Array(
	"images/projects/dias/prj-K01.gif?v=0",
	"images/projects/dias/0trans.gif?v=0",
	"images/projects/dias/0trans.gif?v=0",
	"images/projects/dias/prj-K02.gif?v=0",
	"images/projects/dias/prj-K03.gif?v=0"    );
  var gblHrefS10 = new Array(
  	"../Z-projects/01viviendas/01-prj012/prj01-012.php",
	"#",
	"#",
    "../Z-projects/01viviendas/01-prj004/prj01-004.php",
	"../Z-projects/01viviendas/01-prj004/prj01-004.php"   );
  var gblPauseSecondsS10 = 6;
  var gblFadeSecondsS10 = 1;
  var gblRotationsS10 = 99;

  // End Customization section
  
  var gblDeckSizeS10 = gblImgS10.length;
  var gblOpacityS10 = 100;
  var gblOnDeckS10 = 0;
  var gblStartImgS10;
  var gblStartHrefS10;
  var gblImageRotationsS10 = gblDeckSizeS10 * (gblRotationsS10+1);

 //  window.onload = photoShufflerLaunchS10;
  
  function photoShufflerLaunchS10()
  {
  	var theimgS10 = document.getElementById(gblPhotoShufflerImgIdS10);
        gblStartImgS10 = theimgS10.src; // save away to show as final image
  	var theanchorS10 = document.getElementById(gblPhotoShufflerAnchorIdS10);
        gblStartHrefS10 = theimgS10.href; // save away to show as final image

	document.getElementById(gblPhotoShufflerDivIdS10).style.backgroundImage='url(' + gblImgS10[gblOnDeckS10] + ')';
	setTimeout("photoShufflerFadeS10()",gblPauseSecondsS10*1000);
  }

  function photoShufflerFadeS10()
  {
  	var theimgS10 = document.getElementById(gblPhotoShufflerImgIdS10);
	
  	// determine delta based on number of fade seconds
	// the slower the fade the more increments needed
        var fadeDeltaS10 = 100 / (30 * gblFadeSecondsS10);

	// fade top out to reveal bottom image
	if (gblOpacityS10 < 2*fadeDeltaS10 ) 
	{
	  gblOpacityS10 = 100;
	  // stop the rotation if we're done
	  if (gblImageRotationsS10 < 1) return;
	  photoShufflerShuffleS10();
	  // pause before next fade
          setTimeout("photoShufflerFadeS10()",gblPauseSecondsS10*1000);
	}
	else
	{
	  gblOpacityS10 -= fadeDeltaS10;
	  setOpacityS10(theimgS10,gblOpacityS10);
	  setTimeout("photoShufflerFadeS10()",30);  // 1/30th of a second
	}
  }

  function photoShufflerShuffleS10()
  {
	var thedivS10 = document.getElementById(gblPhotoShufflerDivIdS10);
	var theimgS10 = document.getElementById(gblPhotoShufflerImgIdS10);
	var theanchorS10 = document.getElementById(gblPhotoShufflerAnchorIdS10);
	
	// copy div background-image to img.src
	theimgS10.src = gblImgS10[gblOnDeckS10];
	theanchorS10.href = gblHrefS10[gblOnDeckS10];
	window.status = gblHrefS10[gblOnDeckS10]; // updates status bar (optional)
	// set img opacity to 100
	setOpacityS10(theimgS10,100);

        // shuffle the deck
	gblOnDeckS10 = ++gblOnDeckS10 % gblDeckSizeS10;
	// decrement rotation counter
	if (--gblImageRotationsS10 < 1)
	{
	  // insert start/final image if we're done
	  gblImgS10[gblOnDeckS10] = gblStartImgS10;
	  gblHrefS10[gblOnDeckS10] = gblStartHrefS10;
	}

	// slide next image underneath
	thedivS10.style.backgroundImage='url(' + gblImgS10[gblOnDeckS10] + ')';
  }

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


//--><!]]>