function ViewImage(ifile,ix,iy)
{
	var win;
	var sWidth;
	var sHeight;
	var NS = (document.layers) ? 1 : 0;
	if (NS)
		{
			sWidth = innerWidth;
			sHeight = innerHeight;
		}
		else
		{
			sWidth = document.body.clientWidth;
			sHeight = document.body.clientHeight;
		}
	leftc = (sWidth - ix)/2;
	topc = (sHeight + 50 - iy)/2;
	var addwin = "left="+leftc+",top="+topc+",width="+ix+",height="+iy+",menubar=no,toolbar=no";
	win = window.open("","imageviewer",addwin);
	if (NS)
		{
			sWidth = win.innerWidth;
			sHeight = win.innerHeight;
		}
		else
		{
			sWidth = win.document.body.clientWidth;
			sHeight = win.document.body.clientHeight;
		}
	if(sWidth!=ix || sHeight!=iy)
		{
			win.close();
			setTimeout("ViewImage('"+ifile+"',"+ix+","+iy+")", 250);
			return;
		}
	win.document.open();
	win.document.write("<html><head></head><body>");
	win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
	win.document.write("<img src="+ifile+"></div></body></html>");
	win.document.close();
	win.focus();
}

function open_window(link,w,h,res) //opens new window
{
	var win = "left=100, top=10, width="+w+",height="+h+",menubar=no,location=no,resizable="+res+",scrollbars="+res+"";
	fotoWin = window.open(link,'fotoWin',win);
}

