/***********************************************
* Image Thumbnail Viewer II script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* Visit http://www.dynamicDrive.com for hundreds of DHTML scripts
* This notice must stay intact for legal use
* heavily modified to work with a bit of jquery.
***********************************************/
$(document).ready(
	function()
	{
		init_thumbnail_viewer();
	}
);

//Specify image paths and optional link (set link to "" for no link):
var dynimages=new Array()

//Preload images ("yes" or "no"):
var preloadimg="yes"

//Set optional link target to be added to all images with a link:
var optlinktarget=""

//Set image border width
var imgborderwidth=0

//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"
	
function init_thumbnail_viewer(){	

	
	//
	$(".gallery_thumb img").each(function (i){
			dynimages[i]=[this.src,"#"];
		}
	);
	
	///////No need to edit beyond here/////
	
	if (preloadimg=="yes"){
		for (x=0; x<dynimages.length; x++){
			var myimage=new Image()
			myimage.src=dynimages[x][0]
		}
	}
	
}

function returnimgcode(theimg){
	var imghtml=""
	if (theimg[1]!="")
		/*imghtml='<a href="'+theimg[1]+'" target="'+optlinktarget+'">'*/
	imghtml+='<img src="'+theimg[0]+'" border="'+imgborderwidth+'" width="260" class="galbdr">'
	if (theimg[1]!="")
		/*imghtml+='</a>'*/
	return imghtml
}
	
function modifyimage(loadarea, imgindex){
	if (document.getElementById){
		var imgobj=document.getElementById(loadarea)
		if (imgobj.filters && window.createPopup){
			imgobj.style.filter=filterstring
			imgobj.filters[0].Apply()
		}
		imgobj.innerHTML=returnimgcode(dynimages[imgindex])
		if (imgobj.filters && window.createPopup)
			imgobj.filters[0].Play()
		return false
	}

}



//gallery_page.js
//should re do this in jquery so there are transitons on non-IE browsers the javascript before these comments works, but the script this is based on only does transitions in IE, and not even that is working now

//add hover event handler to all gallery items
// on hover, add/select child image (/large/) inside 'div.gallery_viewer div' with z-index=0 opacity=0
// set any existing img children to z-index=-1; trigger fade out function on previous image
// margin: 0 0 -height -width; left: width; padding:0;display:block;position:relative;
// start animation to make child viewable
// on final callback of animation set all children opacity=0 except current image
// do not destroy imgs after viewing

//fade out function
//triggers on current image when any other image is hovered
//animate decreasing opacity and/or size maintain center
//margin: height-_height/2 width-_width/2 -height+_height/2 -width+_width/2;//keeps centered
//height: height-_height*(step/steps); width: width-_width*(step/steps);