//crea un nuovo popup
//e ci scrive il codice per visualizzare una immagine

/*parametri (tutti obbligatori)
img: percorso dell'immagine
w: larghezza immagine
h: altezza immagine
winName = nome della finestra
*/
function zoom(img,w,h,winName){
    //costruisco le caratteristiche della finestra che devo aprire
    var href = "";
    var winFeature = "toolbar=no,";
    winFeature += "status=no,";
    winFeature += "location=no,";
    winFeature += "menubar=no,";
    winFeature += "resizable=no,";
    winFeature += "scrollbars=no,";
    winFeature += "width=" + w + ",";
    winFeature += "height=" + h + ",";
    winFeature += "top=20,";
    winFeature += "left=20";
    
    //creo la finestra
    var win = window.open(href,winName,winFeature);
    
    //setto il focus
    win.focus();
    
    //costruisco il codice della finestra
    var winCode = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"";
    winCode += "\"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd\">";
    winCode += "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"it\" lang=\"it\">";
    winCode += "<head>";
    winCode += "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />";
    winCode += "<title>RODA We are passionate</title>"; 
    winCode += "<style type=\"text/css\">";
    winCode += "/*<![CDATA[*/";
    winCode += "body{margin:0;padding:0;background-color:#fff}";
    winCode += "/*]]>*/";
    winCode += "</style>";
    winCode += "</head>";
    winCode += "<body>";
    winCode += "<img src=\"" + img + "\" alt=\"\" />";
    winCode += "</body>";
    winCode += "</html>";
    //scrivo il codice
    win.document.write(winCode);
    win.document.close();
}
