/*function popimg(url)
{
	newwindow2=window.open('','Image','height=360,width=480');
	var tmp = newwindow2.document;
	tmp.write('<html><head><title>Copyrighted Image - Unauthorized use prohibited by law</title>');
	tmp.write('<META HTTP-EQUIV="imagetoolbar" CONTENT="no">');
	tmp.write('<SCRIPT LANGUAGE="JavaScript">');
	tmp.write('function closeWin() {');
	tmp.write('window.close();');
	tmp.write('}');
	tmp.write('if (window.Event) document.captureEvents(Event.ONCLICK);');
	tmp.write('document.onclick = closeWin;');
	tmp.write('</script>');
	tmp.write('</head><body oncontextmenu="return false" onselectstart="return false" style="border:0px;margin:0px;padding:0px">');
	tmp.write('<img src="');
	tmp.write(url);
	tmp.write('">');
	tmp.write('</body></html>');
	tmp.close();
}*/

function popimg(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;
    wd = picfile.width; 

    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"; 	
    }
	newwindow2=window.open('','Image',args);
	var tmp = newwindow2.document;
	tmp.write('<html><head><title>Copyrighted Image - Unauthorized use prohibited by law</title>');
	tmp.write('<META HTTP-EQUIV="imagetoolbar" CONTENT="no">');
	tmp.write('<SCRIPT LANGUAGE="JavaScript">');
	tmp.write('function closeWin() {');
	tmp.write('window.close();');
	tmp.write('}');
	tmp.write('if (window.Event) document.captureEvents(Event.ONCLICK);');
	tmp.write('document.onclick = closeWin;');
	tmp.write('</script>');
	tmp.write('</head><body oncontextmenu="return false" onselectstart="return false" style="border:0px;margin:0px;padding:0px">');
	tmp.write('<img src="');
	tmp.write(img);
	tmp.write('">');
	tmp.write('</body></html>');
	tmp.close();
} 