function slideshow2(nm2, mainDiv2, titleDiv2, imgArr2, linkArr2, titleArr2, pauseImage2, newWindow2){
	this.name = nm2;
	this.imgArr2 = imgArr2;
	this.linkArr2 = linkArr2;
	this.titleArr2 = titleArr2;
	this.curPtr = 0;
	this.curDiv = 1;
	this.paused = 0;
	this.pauseImage2 = pauseImage2;
	this.newWindow2 = newWindow2;
	
	var maindv2_2 = document.getElementById(mainDiv2);
	var titleholder2 = document.getElementById(titleDiv2);
	
	document.pfObj2 = this;
	
	document.write("<style type='text/css'>\n");
	document.write("#pf_photo1_2 img, #pf_photo2_2 img { border:1px solid #9ea0a8;visibility:hidden; height:150px; max-width:200px; }\n");
	document.write("#pf_photo1_2 {background-image:url('/img/bg-photo.jpg');background-repeat:repeat;background-position:top left;float:left;margin:0 11 11 0px;padding:10px;border:0px solid #fff;position:absolute; z-index: 1; }\n");
	document.write("#pf_photo2_2 { background-image:url('/img/bg-photo.jpg');background-repeat:repeat;background-position:top left;float:left;margin:0 11 11 0px;padding:10px;position:absolute; z-index: 0; }\n");
	document.write("a img {border:0px;}\n");
	document.write("</style>");
	
	this.initImages = function() {
		document.write("<scr");
		document.write("ipt type='text/javascript'>\n");
		for(var i=0; i<this.imgArr2.length; i++){
			document.write("var img"+i+" = new Image();\n");
			document.write("img"+i+".src = '"+ this.imgArr2[i] +"';\n");					
		}
		document.write("document.pfObj2.start();\n");
		document.write("</scr");
		document.write("ipt>\n");		
	}
	
	this.start = function()
	{
		var dv1_2 = document.createElement("div");
				dv1_2.id = "pf_photo1_2";
				
				dv1_2.innerHTML = "<img alt='" +  titleArr2[0] + "' src='"+ imgArr2[0] +"' />";
				//set link
				dv1_2.lk = linkArr2[0];				
				dv1_2.onclick = function(){gotoLink2(this.lk)};
			
		titleholder2.innerHTML = "<p class='small' style='margin-top:-3px;margin-bottom:5px;width:200px;display:block;'><a title='View " + titleArr2[0] + " Details' style='text-decoration:none;' href='" + linkArr2[0] + "'>" + titleArr2[0] + "</a></p>";
		
		var dv2_2 = document.createElement("div");
				dv2_2.id = "pf_photo2_2";
				
		maindv2_2.appendChild(dv1_2);
		maindv2_2.appendChild(dv2_2);		
		
	  	image1_2 = document.getElementById("pf_photo1_2").childNodes[0];
		image1_2.onmouseover = function(){document.pfObj2.paused = 1};
		image1_2.onmouseout = function(){document.pfObj2.paused = 0};		
		
	  	setOpacity2(image1_2, 0);
	  	image1_2.style.visibility = 'visible';
	  	fadeIn2("pf_photo1_2",0);
	}
	
	this.initImages();
}
	
function gotoLink2(lnk)
{
	if(document.pfObj2.newWindow2 == 1)
		window.open(lnk);
	else
		window.location = lnk;
}

function setOpacity2(obj2, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  
  // IE/Win
  obj2.style.filter = "alpha(opacity:"+opacity+")";
  
  // Safari<1.2, Konqueror
  obj2.style.KHTMLOpacity = opacity/100;
  
  // Older Mozilla and Firefox
  obj2.style.MozOpacity = opacity/100;
  
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj2.style.opacity = opacity/100;
}

function fadeIn2(objId2,opacity) {
  if (document.getElementById) {
    obj2 = document.getElementById(objId2).childNodes[0];
    if (opacity < 100) {
			speed = (speed < 2)?2:speed;
      setOpacity2(obj2, opacity);
			opacityDif = Math.ceil((100-opacity)/speed);
			opacity += opacityDif;
      window.setTimeout("fadeIn2('"+objId2+"',"+opacity+")", 50);
    }
	else
	{			
		if(document.pfObj2.paused == 1 && document.pfObj2.pauseImage2 == 1)
			setTimeout("fadeIn2('"+objId2+"',"+opacity+")", 50);
		else
			setTimeout("swapImages2()",delay*1000);			
	}
  }
}

function swapImages2(){
	// increment or reset image/link counter
	if(document.pfObj2.curPtr == document.pfObj2.imgArr2.length-1)
		document.pfObj2.curPtr = 0;
	else 
		++document.pfObj2.curPtr;

	// get the div to hold the new image
	var dvName2	= (document.pfObj2.curDiv == 1)?"pf_photo2_2":"pf_photo1_2";
	var eDiv2Name2 = (document.pfObj2.curDiv == 1)?"pf_photo1_2":"pf_photo2_2";
	document.pfObj2.curDiv = (document.pfObj2.curDiv == 1)?2:1;
	
	var tgtDiv2 = document.getElementById(dvName2);
	var eDiv2 = document.getElementById(eDiv2Name2);
		
	//fill the target div
	tgtDiv2.innerHTML = "<img alt='" + document.pfObj2.titleArr2[document.pfObj2.curPtr] + "' src='"+ document.pfObj2.imgArr2[document.pfObj2.curPtr] +"' style='visibility:hidden;' />"
	
	//fill the link
	tgtDiv2.lk = document.pfObj2.linkArr2[document.pfObj2.curPtr];
	tgtDiv2.onclick = function(){gotoLink2(tgtDiv2.lk)};
	
	// change the text title
	var titleholder2 = document.getElementById("titleholder2");
	
	titleholder2.innerHTML = "<p class='small' style='margin-top:-3px;margin-bottom:5px;width:200px;display:block;'><a title='View " + document.pfObj2.titleArr2[document.pfObj2.curPtr] + " Details' style='text-decoration:none;' href='" + tgtDiv2.lk + "'>" + document.pfObj2.titleArr2[document.pfObj2.curPtr] + "</a></p>";
	
	//move the divs around in z-index
	eDiv2.style.zIndex = 0;
	tgtDiv2.style.zIndex = 1;
	
	//NEW CODE
	eDiv2.style.visibility = 'hidden';
	eDiv2.childNodes[0].style.visibility = 'hidden';
	tgtDiv2.style.visibility = 'visible';
	
	var img2 = tgtDiv2.childNodes[0];
	img2.onmouseover = function(){document.pfObj2.paused = 1};
	img2.onmouseout = function(){document.pfObj2.paused = 0};
		
	setOpacity2(img2, 0);
	img2.style.visibility = 'visible';
	fadeIn2(tgtDiv2.id,0);
	
}