function showimage(basedir, imageid,window_width,window_height,from_left,from_top)
{

   	day = new Date();
   	id = day.getTime();
   	eval("page" + id + " = window.open(basedir + 'image.php?id=' + imageid, '" + id + "', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=" + window_width + ",height=" + window_height + ",left = " + from_left + ",top = " + from_top + "');");

}

function popup(URL,window_width,window_height,from_left,from_top) {

   	day = new Date();
   	id = day.getTime();
   	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=1,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=" + window_width + ",height=" + window_height + ",left = " + from_left + ",top = " + from_top + "');");

}
   var win= null;
   function NewWindow(mypage,myname,w,h,scroll)
   {
	 	 var winl = (screen.width-w)/2;
     var wint = (screen.height-h)/2;
     var settings  ='height='+h+',';
     settings +='width='+w+',';
     settings +='top='+wint+',';
     settings +='left='+winl+',';
     settings +='scrollbars='+scroll+',';
     settings +='resizable=yes';
     win=window.open(mypage,myname,settings);
   	if(parseInt(navigator.appVersion) >= 4){win.window.focus();}
   }

   function screenpopup(imgurl, imgwidth, imgheight)
   {
   	 var maxwidth = screen.availWidth - 20;
		 var maxheight = screen.availHeight - 40;
	   var width = parseInt(imgwidth) + 40;
	   var height = parseInt(imgheight) + 40;
	   var scrollbars = 0;
	   if (width > maxwidth)
	   {
		   width = maxwidth;
		   scrollbars = 1;
	   }
	   if (height > maxheight)
	   {
		   height = maxheight;
		   scrollbars = 1;
	   }
	   props = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+scrollbars+',resizable=1,width='+width+',height='+height;
	   window.open(imgurl, '', props);
   }

	function referTo(uri)
	{
		window.open(uri);
	}
function Toggle (prefix )
{
	if (document.getElementById(prefix).style.display == 'none')
	{
		document.getElementById(prefix).style.display = "";
	}
	else
	{
		document.getElementById(prefix).style.display = "none";
	}
}

