//Preload images ("yes" or "no"):
var preloadimg="yes"

//Set optional link target to be added to all images with a link:
var optlinktarget=""

//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)"

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 alt="Drop Dead Clothing Product" src="' + theimg[0] + '" />';
	if (theimg[1]!="") { imghtml+='</a>'; }
	return imghtml;
}

function modifyimage(loadarea, imgindex){
	if (document.getElementById){
		$("#"+loadarea).fadeOut("fast", 
			function() {
				var imgobj=document.getElementById(loadarea);
				imgobj.innerHTML = returnimgcode(dynimages[imgindex]);
				$("#"+loadarea).fadeIn("fast");
			}
		);
		
		
		/*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();*/
		
		if(current_image_index > 0){
			document.getElementById("i_control_item_" + current_image_index).className = 'not_active';
			$("#i_control_item_" + current_image_index).fadeTo("slow", 0.33);
		}
		current_image_index = imgindex;
		document.getElementById("i_control_item_" + imgindex).className = 'active';
		$("#i_control_item_" + imgindex).fadeTo("slow", 1);
		
	}
	return false
}