function onContent(f){//(C)webreflection.blogspot.com
var a=onContent,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,".",c,"()}'></scr","ipt>");
a[c]=(function(o){return function(){a[c]=function(){};for(a=arguments.callee;!a.done;a.done=1)f(o?o():o)}})(a[c]);
if(d[e])d[e]("DOMContentLoaded",a[c],false);
if(/WebKit|Khtml/i.test(b)||(w[o]&&parseInt(w[o].version())<9))(function(){/loaded|complete/.test(d[r])?a[c]():setTimeout(arguments.callee,1)})();
else if(/MSIE/i.test(b))d.write(s);
};

function creaBanner300x250() {
eliminaElemento('content_orizz');
spostaInBasso('content_focus','539px');
spostaInBasso('content_right','539px');
// aggiunta nuovo banner con if relativo alla tipologia di pagina in cui ci si trova
var banner300x250 = document.createElement("div");
banner300x250.innerHTML = '<!--/* OpenX iFrame Tag v2.8.1 */-->\
<iframe id=\'a1b5054d\' name=\'a1b5054d\' src=\'http://adserver.sunnycompublishing.it/www/delivery/afr.php?zoneid=24&amp;cb=46546877950313\' framespacing=\'0\' frameborder=\'no\' scrolling=\'no\' width=\'300\' height=\'250\'><a href=\'http://adserver.sunnycompublishing.it/www/delivery/ck.php?n=a9527dea&amp;cb=46546877950313\' target=\'_blank\'><img src=\'http://adserver.sunnycompublishing.it/www/delivery/avw.php?zoneid=24&amp;cb=46546877950313&amp;n=a9527dea\' border=\'0\' alt=\'\' /></a></iframe>\
';
if (window.location.toString().indexOf('/index.do') != -1 || window.location.toString() == 'http://www.comunicandoweb.com/' || window.location.toString() == 'http://comunicandoweb.com/') {
// preparazione elemento content
var contenuto = document.getElementById('content');
var contenutoStyle = 'position:relative;'
contenuto.setAttribute('style', contenutoStyle);
contenuto.style.cssText = contenutoStyle;
var banner300x250Style = 'margin:0; padding:6px 0 0 0; position:absolute; width:353px; height:256px; right:0; text-align:center; top:4px; background-color:#EEEEEE; z-index:1';
document.getElementById('content').appendChild(banner300x250);
} else if (window.location.toString().indexOf('/article.do') != -1 || window.location.toString().indexOf('/news.do') != -1 || window.location.toString().indexOf('/area.do') != -1 || window.location.toString().indexOf('/issue.do') != -1 || window.location.toString().indexOf('/page.do') != -1) {
// preparazione elemento content
var contenuto = document.getElementById('content_focus');
var contenutoStyle = 'overflow:visible; margin: 266px 0 0 0;'
contenuto.setAttribute('style', contenutoStyle);
contenuto.style.cssText = contenutoStyle;
eliminaElemento('eventi');
var banner300x250Style = 'margin:0; padding:6px 0 0 0; position:absolute; width:353px; height:256px; top:-262px; left:0; text-align:center; background-color:#EEEEEE; z-index:1';
var header = document.getElementById('content_focus').firstChild;
var parentContainer = header.parentNode;
parentContainer.insertBefore(banner300x250, header);
//document.getElementById('ie6_right').appendChild(banner300x250);
}
banner300x250.setAttribute('style',banner300x250Style);
banner300x250.style.cssText = banner300x250Style;
setTimeout('creaUltimoNumero();',800);
}

function creaUltimoNumero() {
// aggiunta nuovo banner con if relativo alla tipologia di pagina in cui ci si trova
var UltimoNumero = document.createElement("div");
UltimoNumero.innerHTML = '<table width="353" cellspacing="0" cellpadding="0" border="0"><tbody><tr><td style="background-color:#E10000;"><p style="margin: 4px; font-size: 12px; font-family:Arial, Helvetica, sans-serif; color: white; font-weight: bold;">L\'ultimo uscito...</p></td></tr><tr><td valign="top"><object style="width:100%;height:205px;margin-top:4px;"><param name="movie" value="http://static.issuu.com/webembed/viewers/style1/v1/IssuuViewer.swf?mode=embed&amp;folderId=b9c2da5e-d108-4a98-946c-8e0b764f2d63&amp;layout=http%3A%2F%2Fskin.issuu.com%2Fv%2Flight%2Flayout.xml" /><param name="allowFullScreen" value="true" /><embed src="http://static.issuu.com/webembed/viewers/style1/v1/IssuuViewer.swf" type="application/x-shockwave-flash" allowFullScreen="true" style="width:100%;height:205px;margin-top:5px;" flashvars="mode=embed&amp;folderId=b9c2da5e-d108-4a98-946c-8e0b764f2d63&amp;layout=http%3A%2F%2Fskin.issuu.com%2Fv%2Flight%2Flayout.xml" /></object></td></tr><tr><td style="background-color:#E10000; height: 4px;"><p style="margin: 4px 5px 4px 4px; font-size: 9px; font-family:Arial, Helvetica, sans-serif; color: white; font-weight: bold; text-align:right; text-transform:uppercase;"><a href="http://www.comunicandoweb.com/page.do?id=13" style="text-decoration:none; color:white;">ARCHIVIO NUMERI PRECEDENTI</a></p></td></tr></tbody></table>';
if (window.location.toString().indexOf('/index.do') != -1 || window.location.toString() == 'http://www.comunicandoweb.com/' || window.location.toString() == 'http://comunicandoweb.com/') {
// preparazione elemento content
var contenuto = document.getElementById('content');
var contenutoStyle = 'position:relative;'
contenuto.setAttribute('style', contenutoStyle);
contenuto.style.cssText = contenutoStyle;
var UltimoNumeroStyle = 'margin: 0pt 0pt 10px; padding: 0pt; width: 353px; height: 256px; background-color: white; position:absolute; top:275px; right:0; z-index:1';
document.getElementById('content').appendChild(UltimoNumero);
} else if (window.location.toString().indexOf('/article.do') != -1 || window.location.toString().indexOf('/news.do') != -1 || window.location.toString().indexOf('/area.do') != -1 || window.location.toString().indexOf('/issue.do') != -1 || window.location.toString().indexOf('/page.do') != -1) {
// preparazione elemento content
var contenuto = document.getElementById('content_focus');
var contenutoStyle = 'overflow:visible; margin: 266px 0 0 0;'
contenuto.setAttribute('style', contenutoStyle);
contenuto.style.cssText = contenutoStyle;
var UltimoNumeroStyle = 'margin: 0pt 0pt 10px; padding: 0pt; width: 353px; height: 256px; background-color: white;';
var header = document.getElementById('content_focus').firstChild;
var parentContainer = header.parentNode;
parentContainer.insertBefore(UltimoNumero, header);
//document.getElementById('ie6_right').appendChild(banner300x250);
}
UltimoNumero.setAttribute('style',UltimoNumeroStyle);
UltimoNumero.style.cssText = UltimoNumeroStyle;
}

/////

function eliminajsessionid(){
	var homelink = document.getElementById('home_link').getElementsByTagName('a')[0].getAttribute('href');
	if (homelink.indexOf('jsessionid') != -1 && navigator.cookieEnabled) {
		window.location.reload();
	}
}

/////

function eliminaElemento(elemento) {
var elementodaeliminare = document.getElementById(elemento);
elementodaeliminare.parentNode.removeChild(elementodaeliminare);
}

function spostaInBasso(oggetto, distanza) {
var focusBox = document.getElementById(oggetto);
var focusBoxStyle = 'margin:' + distanza + ' 0 0 0; top:0; padding:0;';
focusBox.setAttribute('style', focusBoxStyle);
focusBox.style.cssText = focusBoxStyle;
}

onContent (function() {
if(!/msie|MSIE 6/.test(navigator.userAgent)) {
setTimeout('eliminajsessionid();',1200);
setTimeout('creaBanner300x250();',1600);
}
});