
var width,height
var image,ext
var cond1,cond2
function transferview(image,width,height) {
				 


/**/
if (document.all)
  viewPic(image);
else
{
	if (width==390) cond1=" "
	 else cond1="width="+(width+20)+""
	if (height==390) cond2=" "
		else cond2="height="+(height+60)+""

	var s1 ="<TITLE>Image</TITLE>"
	var s15=""
	var s2 ="<CENTER><IMG SRC='"+image+"' BORDER=0>"
	var s3 ="<FORM><INPUT TYPE='BUTTON' VALUE='Close Window'"+	" onClick='self.close()'>"
	var s4 ="</FORM></CENTER>"
 
	ImageWindow=window.open("", "newwin"+width,"toolbar=no, scrollbars=yes,menubar=no, resizable=yes,"+cond1+","+cond2);
  ImageWindow.document.write(s1+s15+s2+s3+s4)
	ImageWindow.document.close()
} 
}
function viewPic(img)
{ 	
    picfile = new Image(); 
    picfile.src =(img); 
    fileCheck(img); 
}
function fileCheck(img)
{ 	
    if( (picfile.width!=0) && (picfile.height!=0) )
    { 
        makeWindow(img); 
    }
    else 
    {
        funzione="fileCheck('"+img+"')"; 
        intervallo=setTimeout(funzione,50); 
    }
}
function makeWindow(img)
{ 	
    ht = picfile.height + 18;
    wd = picfile.width + 18; 

    var args= "height=" + ht + ",innerHeight=" + ht;
    args += ",width=" + wd + ",innerWidth=" + wd;
    if (window.screen) 
    { 
        var avht = screen.availHeight; 
        var avwd = screen.availWidth;
        var xcen = (avwd - wd) / 2; 
        var ycen = (avht - ht) / 2;
        args += ",left=" + xcen + ",screenX=" + xcen;
        args += ",top=" + ycen + ",screenY=" + ycen + ",resizable=yes"; 	
    }
    return window.open(img, '', args); 
} 
