
///************************************///

var fullsizeimage = "";
var thumbpath 	  = "../images/";
var thumbtarget   = "";

function showThis(img)
{
	if( img && document.images )
	{
		thumbtarget.src = getFullsizeImageUrl(img);
		if( document.getElementById("myFlashContent") )
			document.getElementById("myFlashContent").style.visibility = "hidden";
	}
}

function thumbRollBack(img)
{
	if( img && document.images )
	{
		thumbtarget.src = fullsizeimage;
		if( document.getElementById("myFlashContent") )
			document.getElementById("myFlashContent").style.visibility = "visible";
	}
}

///************************************///

function getFullsizeImageUrl(img)
{
	var lastindex = img.src.lastIndexOf("/");
	var filename = img.src.substring(lastindex+1);
	var path = img.src.substring(0, lastindex+1);
	
	return path + thumbpath + filename;
}

function registerThumb(img)
{
	img.onmouseover = function(){ showThis(img) };
	img.onmouseout = function(){ thumbRollBack(img) };
	
	img.parentNode.href = '#scroll';
	
	//preload
	var bild = new Image();
  	bild.src = getFullsizeImageUrl(img);
}

///*********** registering ************///

function registerThumbs()
{
	var classname = "thumb";
	thumbtarget = document.images.image;
	fullsizeimage = thumbtarget.src;
	for( var i=0; i<document.images.length; i++ )
	{
		var img = document.images[i];
		if( img.className == classname )
		{
			registerThumb(img);
		}
	}
}

///************************************///