// JavaScript Document

    var http_request = false;

    function makeRequest(url) {

        http_request = false;

        if (window.XMLHttpRequest) { // Mozilla, Safari,...
            http_request = new XMLHttpRequest();
            if (http_request.overrideMimeType) {
                http_request.overrideMimeType('text/xml');
                // See note below about this line
            }
        } else if (window.ActiveXObject) { // IE
            try {
                http_request = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    http_request = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }

        if (!http_request) {
            alert('Giving up :( Cannot create an XMLHTTP instance');
            return false;
        }
        http_request.onreadystatechange = alertContents;
        http_request.open('GET', url, true);
        http_request.send(null);

    }

    function alertContents() {

        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
              var e = document.getElementById("calendario")
			   
			 e.innerHTML = http_request.responseText;
            } else {
                alert('There was a problem with the request.');
            }
        }

    }// JavaScript Document
var indirizzo = "http://www.barattopoli.com/fumetto/";
var primabs = "<table border=0 cellpadding=0 cellspacing=0><tr><td width=7 height=7 background="+indirizzo+"fumetto_r1_c1.gif></td><td width=26 height=7 background="+indirizzo+"fumetto_r1_c2.gif></td><td width=47 background="+indirizzo+"fumetto_r1_c2.gif></td><td width=11  height=7 background="+indirizzo+"fumetto_r1_c2.gif></td><td width=7 height=7 background="+indirizzo+"fumetto_r1_c6.gif></td></tr><tr><td width=7 background="+indirizzo+"fumetto_r2_c1.gif></td><td colspan=3 bgcolor=#eeeeee>";
var dopobs = "</td><td width=7 background="+indirizzo+"fumetto_r2_c6.gif></td></tr><tr><td height=26 colspan=2 rowspan=2 valign=top><img name=fumetto_r4_c1 src="+indirizzo+"fumetto_b_s.gif width=33 height=26 border=0 alt=></td><td height=7 background="+indirizzo+"fumetto_r4_c5.gif></td><td height=7 background="+indirizzo+"fumetto_r4_c5.gif></td><td width=7 height=7 background="+indirizzo+"fumetto_r4_c6.gif></td></tr><tr><td height=19></td><td height=19 colspan=2 valign=top></td></tr></table>";

var primabd ="<table border=0 cellpadding=0 cellspacing=0><tr><td width=7 height=7 background="+indirizzo+"fumetto_r1_c1.gif></td><td height=7 background="+indirizzo+"fumetto_r1_c2.gif></td><td background="+indirizzo+"fumetto_r1_c2.gif></td><td width=26  height=7 background="+indirizzo+"fumetto_r1_c2.gif></td><td width=7 height=7 background="+indirizzo+"fumetto_r1_c6.gif></td></tr><tr><td width=7 background="+indirizzo+"fumetto_r2_c1.gif></td><td colspan=3 bgcolor=#eeeeee>";
var dopobd ="</td><td width=7 background="+indirizzo+"fumetto_r2_c6.gif></td></tr><tr><td height=7 background="+indirizzo+"fumetto_r1_c3.gif></td><td height=7 background="+indirizzo+"fumetto_r4_c5.gif></td><td height=7 background="+indirizzo+"fumetto_r4_c5.gif></td><td colspan=2 rowspan=2><img src="+indirizzo+"fumetto_b_d.gif width=33 height=26></td></tr><tr><td height=19 colspan=2 >&nbsp;</td><td height=19 >&nbsp;</td></tr></table>";

var primaas = "<table border=0 cellpadding=0 cellspacing=0><tr><td colspan=2 rowspan=2 width=33><img src="+indirizzo+"fumetto_a_s.gif width=33 height=26></td><td height=19>&nbsp;</td><td  height=19 colspan=2></td></tr><tr><td height=7 background="+indirizzo+"fumetto_r1_c2.gif></td><td width=9 height=7 background="+indirizzo+"fumetto_r1_c2.gif></td><td width=7 height=7 background="+indirizzo+"fumetto_r1_c6.gif></td></tr><tr><td width=7 background="+indirizzo+"fumetto_r2_c1.gif></td><td colspan=3 bgcolor=#eeeeee>";
var dopoas = "</td><td width=7 background="+indirizzo+"fumetto_r2_c6.gif></td></tr><tr><td width=7 height=7 background="+indirizzo+"fumetto_r1_c3.gif></td><td width=26 height=7 background="+indirizzo+"fumetto_r4_c5.gif></td><td height=7  background="+indirizzo+"fumetto_r4_c5.gif></td><td height=7  background="+indirizzo+"fumetto_r4_c5.gif></td><td width=7 height=7  background="+indirizzo+"fumetto_r4_c6.gif></td></tr></table>";

var primaad = "<table border=0 cellpadding=0 cellspacing=0><tr><td height=19 colspan=2>&nbsp;</td><td height=19>&nbsp;</td><td  height=26 colspan=2 rowspan=2><img src="+indirizzo+"fumetto_a_d.gif width=33 height=26></td></tr><tr><td width=7 height=7 background="+indirizzo+"fumetto_r1_c1.gif></td><td height=7 background="+indirizzo+"fumetto_r1_c2.gif></td><td height=7 background="+indirizzo+"fumetto_r1_c2.gif></td></tr><tr><td width=7 background="+indirizzo+"fumetto_r2_c1.gif></td><td colspan=3 bgcolor=#eeeeee>";
var dopoad = "</td><td width=7 background="+indirizzo+"fumetto_r2_c6.gif></td></tr><tr><td width=7 height=7 background="+indirizzo+"fumetto_r1_c3.gif></td><td height=7 background="+indirizzo+"fumetto_r4_c5.gif></td><td height=7  background="+indirizzo+"fumetto_r4_c5.gif></td><td width=26 height=7  background="+indirizzo+"fumetto_r4_c5.gif></td><td width=7 height=7  background="+indirizzo+"fumetto_r4_c6.gif></td></tr></table>";

function pos(id, evento, data, numero, n_link, n_utenti){

//var evento_X = (evento.x) ? evento.x + document.documentElement.scrollLeft :  evento.layerX;
//var evento_Y = (evento.y) ? evento.y + document.documentElement.scrollTop :  evento.layerY;

var scroll_left = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft;
var scroll_top =document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
var evento_X = (evento.clientX) ? evento.clientX + scroll_left :  evento.layerX;
var evento_Y = (evento.clientY) ? evento.clientY + scroll_top :  evento.layerY;

//var evento_X = evento.clientX;
//var evento_Y = evento.clientY;

var fumetto = document.all? document.all[id] : document.getElementById(id);

var altezzaOgg = fumetto.offsetHeight;
var larghezzaOgg = fumetto.offsetWidth;

if(altezzaOgg == 0){
altezzaOgg = 72;
}
if(larghezzaOgg == 0){
larghezzaOgg = 87;
}

var finestraX = document.body? document.documentElement.clientWidth : window.innerWidth;
var finestraY = document.body? document.documentElement.clientHeight : window.innerHeight;


<!-- -->
if(altezzaOgg > evento.clientY && larghezzaOgg+evento.clientX > finestraX){
var prima = primaad;
var dopo = dopoad;
fumetto.style.top=evento_Y+"px";
fumetto.style.left=evento_X-larghezzaOgg+"px";

}else if(altezzaOgg>evento.clientY){
var prima = primaas;
var dopo = dopoas;
fumetto.style.top=evento_Y+"px";
fumetto.style.left=evento_X+"px";

}else if(larghezzaOgg+evento.clientX>finestraX){
var prima = primabd;
var dopo = dopobd;
fumetto.style.top=evento_Y-altezzaOgg+"px";
fumetto.style.left=evento_X-larghezzaOgg+"px";

}else{
var prima = primabs;
var dopo = dopobs;
fumetto.style.top=evento_Y-altezzaOgg+"px";
fumetto.style.left=evento_X+"px";

}

if(data.length != 0){
var primo_testo =data+"<br/>";
}else{
var primo_testo ="";
}
if(numero.length != 0){
var numero_annunci ="&nbsp;ANNUNCI: <b>"+numero+"</b>";
}else{
var numero_annunci ="";
}
if(n_link.length != 0){
var numero_link ="<br/>&nbsp;LINK: <b>"+n_link+"</b>";
}else{
var numero_link ="";
}
if(n_utenti.length != 0){
var numero_utenti ="<br/>&nbsp;UTENTI: <b>"+n_utenti+"</b>";
}else{
var numero_utenti ="";
}

var style_a ="<span class=\"testopiccolo\">";
var style_b ="</span>";
var messaggio =""+primo_testo+""+numero_annunci+""+numero_link+""+numero_utenti+"";

fumetto.innerHTML = prima + style_a + messaggio + style_b + dopo;
fumetto.style.visibility ="visible";

//fumetto.style.display="block";
}

function hide(id){
	
fumetto = document.all? document.all[id] : document.getElementById(id);
fumetto.style.visibility="hidden";

}
function ritardo_social(qualesocial){
 

 //var iframe ='<iframe src="http://www.facebook.com/plugins/likebox.php?href=http%3A%2F%2Fwww.facebook.com%2Fbarattopoli&amp;width=160&amp;colorscheme=light&amp;connections=4&amp;stream=false&amp;header=false&amp;height=285" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:160px; height:285px;" allowTransparency="true"></iframe>';
  var iframe = "<iframe src='http://www.barattopoli.com/frame_social.php?social="+qualesocial+"' name='esempio' frameborder='0' scrolling='no' width='160' ";
  //var iframe = '<object class="pobject" type="text/html" data="http://www.barattopoli.com/frame_social.php?social='+qualesocial+'" style="overflow: auto; width: 162px; height: 285px; margin-top: 0px"></object>';
  
  var div_social = document.all? document.all['corpo1'] : document.getElementById('corpo1');

  div_social.innerHTML = iframe + "height='285'>";
        
	//div_social.innerHTML = iframe;
    
 //-->
 }

setTimeout('ritardo_social(\'facebook\')', 2500);
// JavaScript Documentfunction addLogin(elemento) {var oggLogin = document.all? document.all[elemento] : document.getElementById(elemento);oggLogin.style.visibility = "visible";oggLogin.style.dislpay = "block";return true;}function escaddLogin(elemento) {var oggLogin = document.all? document.all[elemento] : document.getElementById(elemento);oggLogin.style.visibility = "hidden";oggLogin.style.dislpay = "block";return true;}
