// FUNCITON FOR SLIDESHOW:  SWAP IMAGE AND CAPTION

/*
function SwapImage(name,flipName) {
	document.images[name].src="img/slides_lg/"+flipName+"";
	return false;
	}
	


function ShowImage(c) {
	counter=c;
	SwapImage("subPic",srclist[c]);
	if(uselabels) SwapLabel("rjfa_img_caption",captionlist[c]);
	//if(pagination) ToggleCounter(c);
}
*/



//THIS FUNCTION FLIPS THROUGH THE PHOTOS USING THE PREVIOUS AND NEXT LINKS

thisPic=0;
imgCt = srclist.length-1;

function SwapLabel(id,text) {	
if(document.getElementById) {
	element=document.getElementById(id);
	element.innerHTML=text;
	}
return false;
}



function flipPic(direction) {
	if (document.images) {
		thisPic = thisPic + direction;
		if (thisPic > imgCt) {
			thisPic = 0;
		}
		if (thisPic < 0) {
			thisPic = imgCt;
		}
		//alert(thisPic);
		document.subPic.src="img/slides_lg/"+srclist[thisPic]+"";
		if(uselabels) SwapLabel("rjfa_img_caption",captionlist[thisPic]);
		document.getElementById("curr_img").innerHTML=thisPic+1;
		
	}
}
function chgPic(direction) {
	if (document.images) {
		thisPic = thisPic + direction;
		if (thisPic > imgCt) {
			thisPic = 0;
		}
		if (thisPic < 0) {
			thisPic = imgCt;
		}
		//alert(thisPic);
		document.subPic.src=srclist[thisPic]+"";
		if(uselabels) SwapLabel("rjfa_img_caption",captionlist[thisPic]);
		document.getElementById("curr_img").innerHTML=thisPic+1;
		
	}
}
var uselabels=true;
/**
 * Cross-browser script to an object. Make sure id and name are set. 
 * DOES NOT ALWAYS WORK WELL WITH LAYERS
 * found at apple developer site... author unknown
 **/
function getAnObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
		// W3C DOM
		return document.getElementById(objectId);
    } else if (document.all && document.all(objectId)) {
		// MSIE 4 DOM
		return document.all(objectId);
    } else if (document.layers && document.layers[objectId]) {
		// NN 4 DOM.. note: this won't find nested layers
		return document.layers[objectId];
    } else {
		return false;
    }
} // getAnObject

/**
 * Simple script to flip images. You should
 * author: unknown
 **/
function imgFlip(target,changeto) {
	if (target==changeto) return;
    found = getAnObject( target );
    found.src = eval(changeto + ".src");
}
/**
 * Simple function to open pop-up windows.
 **/
function openWin(url,name,height,width,details) {
    if (name == null) {
        name='preview';
    }
	if (height==null || height=="") height=600;
	if (width==null || width=="") width=600;
	if (details == null || details=="") details='scrollbars=yes,resizable=yes,menubar=yes,location=yes,status=yes,toolbar=yes,height=' + height +',width=' + width;
    x = window.open(url,name,details);
	x.focus();
    return;
}