/*
 * Funzioni di utilizzo comune all'interno dell'applicazione.
 *
 * Mario Imperato January 2005
 */

function viewFile(sPage, x, y)
{
     filew = window.open(sPage, "FILE_Window", "dependent,resizable,scrollbars,status,width=" + x + ",height=" + y);
     filew.focus();
     return;
}

var gwf_imageName    = false;
var gwf_pickerWindow = false;

function gwfCloseSecondaryWindow()
{ 
  if (gwf_pickerWindow) {
        if (!gwf_pickerWindow.closed) gwf_pickerWindow.close();
  }
}

function viewImage(imageName, htmlFile, x, y)
{
     gwfCloseSecondaryWindow();
     
	 gwf_imageName = imageName;
     gwf_pickerWindow = window.open(htmlFile, "FILE_Window", "dependent,resizable,scrollbars,status,width=" + x + ",height=" + y);
     gwf_pickerWindow.focus();
     return;
}

function gwfOpenSecondaryWindow(htmlFile, x, y)
{
     gwfCloseSecondaryWindow();
     
     gwf_pickerWindow = window.open(htmlFile, "FILE_Window", "dependent,resizable,scrollbars,status,width=" + x + ",height=" + y);
     gwf_pickerWindow.focus();
     return;
}

function displayImageOnLoad()
{
     var resImage   = new Image();
     resImage.src   = window.opener.gwf_imageName;
     //alert(document['gwfImageId'] + '/' + window.opener.gwf_imageName);
     // alert(resImage.src);
     document['gwfImageId'].src = resImage.src;

     // return;
}

