/***********************************************
* Image Thumbnail viewer- ? Dynamic Drive (www.dynamicdrive.com)
* Last updated Sept 26th, 03'. This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var ie=document.all;
var ns6=document.getElementById&&!document.all;


function ietruebody()
{
	return (document.compatMode && document.compatMode!="BackCompat" && !window.opera)? document.documentElement : document.body
}

function enlarge(which, e, position, imgwidth, imgheight)
{
	if(ie||ns6)
	{
		crossobj=document.getElementById? top.document.getElementById("showimage") : top.document.all.showimage;
		if(!crossobj)
		{
			crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage;
		}
		if(!crossobj)
		{
			return true;
		}
		crossobj.style.left="40px"
		crossobj.style.top="40px"
		crossobj.innerHTML='<div style=""><img src="'+which+'"></div><div id="dragbar"><span id="closetext" onClick="closepreview()">Fenster schliessen</span></div>';
		crossobj.style.visibility="visible"
		return false;
	}
	//if NOT IE 4+ or NS 6+, simply display image in full browser window
	return true
}

function closepreview()
{
	if(ie||ns6)
	{
		crossobj=document.getElementById? top.document.getElementById("showimage") : top.document.all.showimage;
		if(!crossobj)
		{
			crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage;
		}
		if(!crossobj)
		{
			return true;
		}
		crossobj.style.visibility="hidden"
	}
}

function drag_drop(e)
{
	if(ie||ns6)
	{
		crossobj=document.getElementById? top.document.getElementById("showimage") : top.document.all.showimage;
		if(!crossobj)
		{
			crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage;
		}
		if(!crossobj)
		{
			return true;
		}
	}
	if(ie&&dragapproved)
	{
		crossobj.style.left=tempx+event.clientX-offsetx+"px"
		crossobj.style.top=tempy+event.clientY-offsety+"px"
	}
	else if(ns6&&dragapproved)
	{
		crossobj.style.left=tempx+e.clientX-offsetx+"px"
		crossobj.style.top=tempy+e.clientY-offsety+"px"
	}
	return false;
}

function initializedrag(e)
{
	if (ie||ns6){
		crossobj=document.getElementById? top.document.getElementById("showimage") : top.document.all.showimage;
		if(!crossobj)
		{
			crossobj=document.getElementById? document.getElementById("showimage") : document.all.showimage;
		}
		if(!crossobj)
		{
			return true;
		}
	}
	if(ie&&event.srcElement.id=="dragbar"||ns6&&e.target.id=="dragbar")
	{
		offsetx=ie? event.clientX : e.clientX
		offsety=ie? event.clientY : e.clientY
		tempx=parseInt(crossobj.style.left);
		tempy=parseInt(crossobj.style.top);
		dragapproved=true;
		document.onmousemove=drag_drop;
	}
}

document.onmousedown=initializedrag;
document.onmouseup=new Function("dragapproved=false");

