function admShowModalDialog(wUrl, wName, wWidth, wHeight, wLeft, wTop) //wLeft=-1 (center)  wTop=-1 (middle)
{
	var h=null;    
	if (window.showModalDialog)
	{
       h = window.showModalDialog(wUrl, window,"help:0;center:1;status:1;scroll:0;font-family:Verdana; resizable:1;font-size:12; dialogWidth:"+wWidth+"px; dialogHeight:"+wHeight+"px;");
    }
	else
    {
	 	h = window.open(wUrl, wName, "left=100,top=100,width="+wWidth+",height="+wHeight+",dependent,modal,resizable=1");
	    window.onfocus=function()
       {
		   if(h && !h.closed)
		   {
			    h.focus();
		   }		
       }
    }
	return h;
}		


function popFoto(tImg, tWidth,tHeight)
{
	popWidth=tWidth+16;
	popHeight=tHeight+16;
	//hvis tWidth>clientwidth saa skal winduet vaere mindre og det samme med hojden			
	useScrollbars="yes";
	if (popWidth<screen.availWidth && popWidth<screen.availHeight)
	{			
		useScrollbars="yes";
	}
	else
	{
		popWidth=screen.availWidth;
		popWidth=screen.availHeight;
		useScrollbars="yes";
	}
	
	surl = '/u/show_img.php?img='+tImg+'&imgWidth='+tWidth+'&imgHeight='+tHeight;
	WindowXOffset = screen.width/2 - popWidth/2;
	WindowYOffset = screen.height/2 - popHeight/2 - 40;
	if(WindowYOffset < 0){
		WindowYOffset = 0;
	}
	

	window.open(surl,"Foto", "left=" + WindowXOffset + ",top=" + WindowYOffset + ",WIDTH="+popWidth+",HEIGHT="+popHeight+",menubar=no,location=no,toolbar=no,status=yes,scrollbars="+useScrollbars+",resizable=yes");

}
