function Foto(img)
{
  foto1= new Image();
  foto1.src=(img);
  Controlla(img);
}
function Controlla(img)
{
  if((foto1.width!=0)&&(foto1.height!=0))
  {
	viewFoto(img);
  }
  else
  {
	funzione="Controlla('"+img+"')";
	intervallo=setTimeout(funzione,20);
  }
}
function viewFoto(img)
{
	largh=foto1.width;
	altez=foto1.height;
	var left = (screen.width / 2) - (largh / 2)
	var top =  (screen.availHeight / 2)	- (altez / 2)
	stringa="width="+largh+",height="+altez+",left="+left+",top="+top;
	finestra=window.open("http://www.tornado-surf.com/english/picture.htm?"+img,"",stringa);
}
function openWindow(url)
{
	Foto(url);
	return;

	var i = 0;
	var picture = new Image();
	picture.src = "";
	picture.src = url;
	var loaded=false;
	function f1() {loaded=true;}
	window.onload=f1;
	var width = picture.width;
	var height = picture.height;
	var left = (screen.width / 2) - (width / 2)
	var top =  (screen.availHeight / 2)	- (height / 2)
	try
	{
		newWnd.close();
	}
	catch(e){}
	newWnd = window.open("http://www.tornado-surf.com/english/picture.htm?"+url,"Fenster","width="+width+",height="+height+",left=0,top=0");
	newWnd.focus();
}

function openSeperateWindow(url, width, height)
{
	height = height + 26;
	width = width + 26;
	var left = (screen.width / 2) - (width / 2)
	var top =  (screen.availHeight / 2)	- (height / 2)
	try
	{
		newWnd.close();
	}
	catch(e){}
	newWnd = window.open(url,"Fenster","width="+width+",height="+height+",left="+left+",top="+top);
	newWnd.focus();
}