function photofader2(nm2, mainDiv2, imgArr2){
	this.name2		= nm2;
	this.imgArr2 = imgArr2;
	this.curImg2 = 0;
	this.curDiv2 = 1;
	
	var mainDv2 = document.getElementById(mainDiv2);
	
	document.pf2Obj = this;
	
	document.write("<style type='text/css'>\n");
	document.write("#pf2_photo1 img { visibility:hidden; }\n");

	document.write("</style>");
	
	this.initImages = function() {
		document.write("<scr");
		document.write("ipt type='text/javascript'>\n");
		for(var x=0; x<this.imgArr2.length; x++){
			document.write("var img"+x+" = new Image();\n");
			document.write("img"+x+".src = '"+ this.imgArr2[x] +"';\n");
		}
		document.write("document.pf2Obj.start();\n");
		document.write("</scr");
		document.write("ipt>\n");
		
	}
	
	this.start = function(){
		var hldr12 = "pf2_photo1";
		var hldr22 = "pf2_photo2";
		
		var dv12 = document.createElement("div");
				dv12.id = "pf2_photo1";
				dv12.innerHTML = "<img src='"+ imgArr2[0] +"' />";
		var dv22 = document.createElement("div");
				dv22.id = "pf2_photo2";
		
		mainDv2.appendChild(dv12);
		mainDv2.appendChild(dv22);
		
	  image12 = document.getElementById(hldr12).childNodes[0];
		
	  setOpacity2(image12, 0);
	  image12.style.visibility = 'visible';
	  fadeIn2(hldr12,0);
	}
	
	this.initImages();
}
	
function setOpacity2(obj, opacity2) {
  opacity2 = (opacity2 == 100)?99.999:opacity2;
  
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity2+")";
  
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity2/100;
  
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity2/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity2/100;
}

function fadeIn2(objId,opacity2) {
  if (document.getElementById) {
    obj = document.getElementById(objId).childNodes[0];
    if (opacity2 < 100) {
			speed2 = (speed2 < 2)?2:speed2;
      setOpacity2(obj, opacity2);
			opacityDif2 = Math.ceil((100-opacity2)/speed2);
			opacity2 += opacityDif2;
      //opacity2 += 2;
      window.setTimeout("fadeIn2('"+objId+"',"+opacity2+")", 100);
    }
		else
			setTimeout("swapImages2()",delay2*1000);
  }
}

function swapImages2(){
	// find out which 
	if(document.pf2Obj.curImg2 == document.pf2Obj.imgArr2.length-1)
		document.pf2Obj.curImg2 = 0;
	else 
		++document.pf2Obj.curImg2;

	// now get the div to hld the new image
	var dvName	= (document.pf2Obj.curDiv2 == 1)?"pf2_photo2":"pf2_photo1";
	var eDivName		= (document.pf2Obj.curDiv2 == 1)?"pf2_photo1":"pf2_photo2";
	document.pf2Obj.curDiv2 = (document.pf2Obj.curDiv2 == 1)?2:1;
	
	var tgtDiv = document.getElementById(dvName);
	var eDiv = document.getElementById(eDivName);
	
	// now fill the target div
	tgtDiv.innerHTML = "<img src='"+ document.pf2Obj.imgArr2[document.pf2Obj.curImg2] +"' style='visibility:hidden;' />";
	
	//move the divs around in z-index
	eDiv.style.zIndex = 0;
	tgtDiv.style.zIndex = 1;
	
	// And finally fade in the image
	
  var img = tgtDiv.childNodes[0];
	
  setOpacity2(img, 0);
  img.style.visibility = 'visible';
  fadeIn2(tgtDiv.id,0);
}