// --- Copyright (c) 2004 Bluemedia - www.bluemedia.at ----------------------
// --- To receive the right to license this code to use on your site the  ---
// --- original code must be received from bluemedia (media@bluechip.at). ---
// --- License is granted if you use the original code and only if this   ---
// --- entire copyright notice is included, and you link from the page on ---
// --- which the code is used to Bluemedia - http://www.bluemedia.at  -------
// --- code by Edermayr Ronald ----------------------------------------------

function swapImage(picnum){
	if (document.images.galleryimage != null && document.images["pic" + picnum] != null && typeof imageContainer == "object" && typeof imageContainerL == "object") {
		var img = document.images.galleryimage.src;
		var img1 =  document.images["pic" + picnum].src;
		img = parseInt(img.substr(img.indexOf('_img0')+5,1));
		img1 = parseInt(img1.substr(img1.indexOf('_img0')+5,1));	

		if (document.all){
			document.images.galleryimage.style.filter="blendTrans(duration=1)"
			document.images.galleryimage.style.filter="blendTrans(duration=crossFadeDuration)"
			document.images.galleryimage.filters.blendTrans.Apply();
		
			document.images["pic" + picnum].style.filter="blendTrans(duration=1)"
			document.images["pic" + picnum].style.filter="blendTrans(duration=crossFadeDuration)"
			document.images["pic" + picnum].filters.blendTrans.Apply();
		}
	
		document.images.galleryimage.src = imageContainerL[img1].src;
		document.images["pic" + picnum].src = imageContainer[img].src;

		if (document.all){
			document.images.galleryimage.filters.blendTrans.Play();
			document.images["pic" + picnum].filters.blendTrans.Play();
		}
	}
}