// Javascript functions

function popWindow(url, w, h) {
	var ww = w + 20;
	var wh;
	if (h == 0)
		wh = screen.height - 60;
	else
		wh = h + 20;
	newWin = window.open(url, "syn" , 'width='+ww+', height='+wh+', left=20,top=20, scrollbars,resizable');
	newWin.focus();
}

// Autosized window
function popImgSize(img){
  pimg= new Image();
  pimg.src=(img);
  imgCtrl(img);
}
function imgCtrl(img){
  if((pimg.width!=0) && (pimg.height!=0))
    viewImg(img);
  else{
    funzione="imgCtrl('"+img+"')";
    intervallo = setTimeout(funzione,20);
  }
}
function viewImg(img){
  w = pimg.width+20;
  h = pimg.height+20;
  imgStr = "width="+w+",height="+h;
  imgWin = window.open(img,"",imgStr);
}

