function show_shadow(img,imgwidth,imgheight,title)
{
	width=imgwidth+20;
	height=imgheight+20;
	options = "width="+width+",height="+height+",left=100,top=200";
	window.open("window.php?image="+img+"&title="+title, title, options);
}

function show_shadow_old(img,imgwidth,imgheight)
{
	document.getElementById("shadow").style.display="block";
	document.getElementById("shadowpicture").style.display="block";
	image = new Image();
	image.id = "image_large";
	image.name = "image_large";
	image.src = img;
	image.alt = "large";
	image.title = image.id;
	image.className = "input_img_add";
	element = document.getElementById("shadowpicture");

	if ((!document.all)&&(document.getElementById)){
       image.setAttribute('onClick','hide_shadow()');
   		 }    
   //workaround for IE 5.x
   if ((document.all)&&(document.getElementById)){
       image["onclick"]=new Function('hide_shadow()');
   }

	windowsize=mySize();
	
	left=myleftpos(imgwidth,windowsize[0]);
	top=mytoppos(imgheight,windowsize[1]);
	

	//alert(left+ "und" + top );
	element.appendChild(image);
	element.style.left=""+left+"px";
	element.style.top=""+top+"px";
}

function hide_shadow()
{
	document.getElementById("shadow").style.display="none";
	document.getElementById("shadowpicture").style.display="none";
	document.getElementById('shadowpicture').removeChild(document.getElementById('shadowpicture').firstChild);
}

function mySize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  theSize=Array(myWidth,myHeight);
  return theSize;
}

function myleftpos(mywidth,windowwidth)
{
	leftpos = windowwidth/2 - mywidth/2 - 10;
	return leftpos;
}

function mytoppos(myheight,windowheight)
{
	toppos = windowheight/2 - myheight/2 - 10;
	if (toppos<10)
	{
		toppos=10;
	}
	return toppos;
}
