function id2obj(id){
	return document.all?document.all[id]:document.getElementById?document.getElementById(id):undefined;
}
function carica(){
    if(self!=top)top.location=self.location;
    gestLink();
    try{auxload()}catch(e){}
    try{adminauxload()}catch(e){}
}
function onContent(f){
var b=navigator.userAgent,d=document,w=window,
c="__onContent__",e="addEventListener",o="opera",r="readyState",
s="<scr".concat("ipt defer src='/","/:' on",r,"change='if(this.",r,"==\"complete\"){this.parentNode.removeChild(this);",c,"()}'></scr","ipt>");
w[c]=(function(o){return function(){w[c]=function(){};f(o?o():o)}})(w[c]);
if(d[e])d[e]("DOMContentLoaded",w[c],false);
if(/WebKit|Khtml/i.test(b)||(w[o]&&parseInt(w[o].version())<9))
(function(){/loaded|complete/.test(d[r])?w[c]():setTimeout(arguments.callee,1)})();
else if(/MSIE/i.test(b))d.write(s);
};
function gestLink() {
    var anchors = document.getElementsByTagName("a");
    for (var i=0; i<anchors.length; i++) {
        var a = anchors[i];
        //a.target="_top";
        var rel=a.getAttribute("rel");
        if(rel){
            if(rel.indexOf("altpopup")!=-1) {
                a.target="_blank";
            }
            if(rel.indexOf("blank")!=-1||rel.indexOf("external")!=-1) {
                a.target="_blank";
                if (a.title){
                    a.title += " [Il link apre una nuova finestra]";
                }else{
                    a.title = "Il link apre una nuova finestra";
                }
            }
        }
    }
}

function aggEventi(ogg,evnt,func){
    if(ogg.attachEvent){
        ogg.attachEvent("on"+evnt,func);
    }else{
        ogg.addEventListener(evnt,func,false);
    }
}
function shSocial(id){
    var a=id2obj('ss'+id);
    if(a){
        if(a.style.display=="none") {
            a.style.display="block";
            openSocial[id]=1;
        }else{
            a.style.display="none";
            openSocial[id]=1;
        }
    }
}

function popup(url,nome,w,h,r){
    var l=(screen.width-w)/2;
    var t=(screen.height-h)/2;
    var ogg=window.open(url,nome,'height='+h+',width='+w+',top='+t+',left='+l+',scrollbars=1,resizable='+r+',menubar=0,toolbar=0,location=0,statusbar=1');
    ogg.window.focus();
}
//window.onload=carica;
onContent(carica);
//indow.onerror=gesterrore;
