// JavaScript Document
function centerPopUp( url, name, width, height, scrollbars ) { 

if( scrollbars == null ) scrollbars = "0" 

str = ""; 
str += "resizable=1,"; 
str += "scrollbars=" + scrollbars + ","; 
str += "width=" + width + ","; 
str += "height=" + height + ","; 

if ( window.screen ) { 
var ah = screen.availHeight - 30; 
var aw = screen.availWidth - 10; 

var xc = ( aw - width ) / 2; 
var yc = ( ah - height ) / 2; 

str += ",left=" + xc + ",screenX=" + xc; 
str += ",top=" + yc + ",screenY=" + yc; 
}
window.open( url, name, str ); 
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function popup(str,lun,alt)
{
   //str2 = "http://www.polycastrum.it/pgincluse/dati/" + str;
   XX = (screen.width / 2) - (lun / 2);
   YY = (screen.height / 2) - (alt / 2);
   PopBigFoto = window.open(str,"Foto","width="+ lun + ",height=" + alt +",scrollbars=no,status=yes");
   PopBigFoto.moveTo(XX,YY);
   PopBigFoto.focus();
}

function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}


// Bottom Bar


function createCookie(name,value,days) {

if (days) {
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else var expires = "";
document.cookie = name+"="+value+expires+"; path=/forum/";
}

function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}



var DoPop=readCookie('ENpopover');

if (!DoPop){
var delay='2'; // How many seconds before window opens
setTimeout('showbar()',delay*1000);
}

function showbar(){
	document.getElementById('bottombar').style.display = "block";
}

function killbar(){
document.getElementById('bottombar').style.display = "none";
createCookie('ENpopover',0,365);
}

function hidebar(){
document.getElementById('bottombar').style.display = "none";
}
// Fine Bottom Bar