<!--

        // ADDED BY RaSca

var popWindow_;

function popupImage(url)
{
 var height = screen.height;
 var width = screen.width;
 var leftpos = width / 2 - 50;
 var toppos = height / 2 - 50;

 window.open(url,'popupImage','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,left=150')
}

function OpenImg(aImage, w, h, nome) {
        if ((popWindow_ == null) || (popWindow_.closed)) {
              if (!h) h = 500;
              if (!w) w = 500;
              sh = (screen.availHeight/2)-(h/2);
              sw = (screen.availWidth/2)-(w/2);
              popWindow_ = window.open("", nome, "height=" + h + ",width=" + w + ",top=" + ((screen.availHeight/2)-(h/2)) + ",left=" + ((screen.availWidth/2)-(w/2)) +",alwaysLowered=0,alwaysRaised=1,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=0,status=0,titlebar=0,toolbar=0,maximized=1,z-lock=0");
              popWindow_.document.write("<html><body style=\"background:#FFFFFF; margin:0px;\"><table width=100% height=100% style=\"background:#FFFFFF; margin:0px;\"><tr><td align=center valign=center><img src=\"images/" + aImage + "\"></td></tr></table></body></html>");
                popWindow_.focus();
        } else {
                popWindow_.location.href=aUrl;
                popWindow_.focus();
        }

}

function popUrl(aUrl, w, h, nome) {

        if ((popWindow_ == null) || (popWindow_.closed)) {
                popWindow_ = window.open(aUrl, nome, "height=" + h + ",width=" + w + ",top=" + ((screen.availHeight/2)-(h/2)) + ",left=" + ((screen.availWidth/2)-(w/2)) +",location=center,menubar=no,resizable=yes,scrollbars=yes,toolbar=no,fullscreen=0");
                popWindow_.focus();
        } else {
                popWindow_.location.href=aUrl;
                popWindow_.focus();
        }

}

function popImage(aImage, w, h, nome) {
        if ((popWindow_ == null) || (popWindow_.closed)) {
                sh = (screen.availHeight/2)-(h/2);
              sw = (screen.availWidth/2)-(w/2);
              popWindow_ = window.open("", nome, "height=" + h + ",width=" + w + ",top=" + ((screen.availHeight/2)-(h/2)) + ",left=" + ((screen.availWidth/2)-(w/2)) +",alwaysLowered=0,alwaysRaised=1,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=1,scrollbars=yes,status=0,titlebar=0,toolbar=0,z-lock=0");
              popWindow_.document.write("<html><body bgcolor:#FFFFFF; STYLE=\"margin:0px;\"><center><IMG SRC=\"" + aImage + "\"></center></body></html>");
                popWindow_.focus();
        } else {
                popWindow_.location.href=aUrl;
                popWindow_.focus();
        }

}

function popUrlNoResize(aUrl, w, h, nome) {

        if ((popWindow_ == null) || (popWindow_.closed)) {
                sh = (screen.availHeight/2)-(h/2);
              sw = (screen.availWidth/2)-(w/2);
              popWindow_ = window.open(aUrl, nome, "height=" + h + ",width=" + w + ",top=" + ((screen.availHeight/2)-(h/2)) + ",left=" + ((screen.availWidth/2)-(w/2)) +",alwaysLowered=0,alwaysRaised=1,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=0,status=0,titlebar=0,toolbar=0,z-lock=0");
                popWindow_.focus();
        } else {
                popWindow_.location.href=aUrl;
                popWindow_.focus();
        }
}

function popUrlFull(aUrl, w, h, nome) {
if ((popWindow_ == null) || (popWindow_.closed)) {
        popWindow_ = window.open(aUrl, nome, "height=" + h + ",width=" + w + ",top=" + ((screen.availHeight/2)-(h/2)) + ",left=" + ((screen.availWidth/2)-(w/2)) +",menubar=yes,resizable=yes,scrollbars=yes,toolbar=yes,location=yes,status=yes");
        popWindow_.focus();
} else {
        popWindow_.location.href=aUrl;
        popWindow_.focus();
}
}

function MakeWindow(PageUrl)
{
        myWindow = window.open(PageUrl,'promo','top=225,left=150,height=100,width=180,alwaysLowered=0,alwaysRaised=1,channelmode=0,dependent=0,directories=0,fullscreen=0,hotkeys=1,location=0,menubar=0,resizable=0,status=0,titlebar=0,toolbar=0,z-lock=0');
        if (!myWindow.opener) myWindow.opener = main;
}

function addDate() {
   monthNames = new Array("Gennaio","Febbraio","Marzo","Aprile","Maggio","Giugno","Luglio","Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre");
   myDate  = new Date();
   var year = myDate.getYear();
   if (year < 1000) year += 1900;
   document.write("<FONT SIZE='1'>" + myDate.getDate() +"  "+monthNames[myDate.getMonth()] + "  " +  year + "</FONT>");
}

function nl2br(text) {
 text = text.replace(/\r\n|\r|\n/g, '<br \/>');
 return text;
}

function getParamsByName() {
 // Definisco le variabili che mi servono
 var i = 0;
 var param = '';
 inputstr = new Array();
 params = new Array();

 // Reperisco il valore della stringa dei parametri dall'indirizzo
 query = '' + this.location;
 query = query.replace(/%20/gi, ' ');
 query = query.substring((query.indexOf('?')) + 1);

 // Creo un array con i valori nomeparametro = valoreparametro
 inputstr = query.split('&');

 // Creo il nuovo array in modo che sia params[nomeparametro]=valoreparametro
 while (i != inputstr.length)
 {
  param = inputstr[i];
  params[param.substring(0, param.indexOf('='))] = param.substring((param.indexOf('=')) + 1);
  i = i + 1;
 }
 return params;
}

function getParamsByNumber() {
 // Definisco le variabili che mi servono
 var i = 0;
 var param = '';
 inputstr = new Array();
 params = new Array();

 // Reperisco il valore della stringa dei parametri dall'indirizzo
 query = '' + this.location;
 query = query.replace(/%20/gi, ' ');
 query = query.substring((query.indexOf('?')) + 1);

 // Creo un array con i valori nomeparametro = valoreparametro
 inputstr = query.split('&');

 // Creo il nuovo array in modo che sia params[indiceelemento]=valoreparametro
 while (i != inputstr.length)
 {
  param = inputstr[i];
  params[i] = param.substring((param.indexOf('=')) + 1);
  i = i + 1;
 }
 return params;
}

        // END RaSca

	// POPUP WINDOW
	function openpopup(popurl, w, h, sizable) {
		str = 'width='+(w+20)+',height='+(h+30);
		if ( sizable != true ) {
			str = str + ',scrollbars=no,resizable=no,status=no';
		} else {
			str = str + ',scrollbars=yes,resizable=yes,status=yes';
		}
		window.open(popurl,'',str);
	}
	
	// ARRAY PROTOTYPES
	Array.prototype.contains = function (element) {
		for ( var i=0; i<this.length; i++ ) {
			if ( this[i]==element ) {
				return i;
			}
		}
		return false;
	}
	
	Array.prototype.remove = function (element) {
		var result = false;
		var array = [];
		for (var i = 0; i < this.length; i++) {
			if (this[i] == element) {
				result = true;
			} else {
				array.push(this[i]);
			}
		}
		this.length = 0;
		for (var i = 0; i < array.length; i++) {
			this.push(array[i]);
		}
		array = null;
		return result;
	};
	
	Array.prototype.addUnique = function (element) {
		if (this.contains(element) === false) {
			this.push(element);
		}
	};
	
	// Read the JavaScript cookies tutorial at:
	// http://www.netspade.com/articles/javascript/cookies.xml
	
	// SET COOKIE
	function setCookie(name, value, days, expires, path, domain, secure) {
		if (days) {
			expires = new Date();
			expires.setTime(expires.getTime()+(days*24*60*60*1000));
		}
		
		document.cookie= name + "=" + escape(value) +
			((expires) ? "; expires=" + expires.toGMTString() : "") +
			((path) ? "; path=" + path : "") +
			((domain) ? "; domain=" + domain : "") +
			((secure) ? "; secure" : "");
	}
	
	// GET COOKIE
	function getCookie(name) {
		var dc = document.cookie;
		var prefix = name + "=";
		var begin = dc.indexOf("; " + prefix);
		if (begin == -1) {
			begin = dc.indexOf(prefix);
			if (begin != 0) return null;
		} else {
			begin += 2;
		}
		var end = document.cookie.indexOf(";", begin);
		if (end == -1) {
			end = dc.length;
		}
		return unescape(dc.substring(begin + prefix.length, end));
	}
	
	// DELETE COOKIE
	function deleteCookie(name, path, domain) {
		if (getCookie(name)) {
			document.cookie = name + "=" + 
				((path) ? "; path=" + path : "") +
				((domain) ? "; domain=" + domain : "") +
				"; expires=Thu, 01-Jan-70 00:00:01 GMT";
		}
	}
	
	// TOGGLE BLOCK
	function toggleBlock(id, forceHidden) {
		forceHidden = (forceHidden==undefined) ? false : forceHidden;
		
		// Variables
		var toggleObj;
		var linkObj;
		
		// Get Element
		if (document.getElementById) {
			// this is the way the standards work: Safari, FireFox
			toggleObj = document.getElementById('toggle'+id);
			linkObj = document.getElementById('link'+id);
		} else if (document.all) {
			// this is the way old msie versions work
			toggleObj = document.all['toggle'+id];
			linkObj = document.all['link'+id];
			
		} else if (document.layers) {
			// this is the way nn4 works
			toggleObj = document.layers['toggle'+id];
			linkObj = document.layers['link'+id];
		}
		
		// Toggle
		var cookieStr = getCookie('toggledItems');
		var toggleArr = Array();
		if (cookieStr) {
			toggleArr = cookieStr.split(',');
		}
		
		if (toggleObj) {
			styleObj = toggleObj.style;
			if (styleObj.display != "none" || forceHidden==true) {
				// HIDE
				toggleArr.addUnique(id);
				styleObj.display = "none";
				if (linkObj) {
					twistyObj = linkObj.getElementsByTagName('img')[0];
					
					if (twistyObj) {
						twistyObj.setAttribute('src', blogSettings['img_path'] + 'plus.gif');
						twistyObj.setAttribute('alt','[+]');
					} else {
						linkObj.innerHTML = "[+]";
					}
				}
			} else {
				// SHOW
				toggleArr.remove(id);
				styleObj.display = "block";
				if (linkObj) {
					twistyObj = linkObj.getElementsByTagName('img')[0];
					
					if (twistyObj) {
						twistyObj.setAttribute('src', blogSettings['img_path'] + 'minus.gif');
						twistyObj.setAttribute('alt','[-]');
					} else {
				linkObj.innerHTML = "[-]";
			}
				}
			}
			setCookie('toggledItems', toggleArr.toString(),30);
		}	
	}
	
	// DEFAULT PAGE INIT FUNCTION
	function init() {
		var cookieStr = getCookie('toggledItems');
		var toggleArr = Array();
		
		if (cookieStr) {
			toggleArr = cookieStr.split(',');
			for ( var i=0; i<toggleArr.length; i++ ) {
				toggleBlock(toggleArr[i], true);
			}
		}
	}
	
	function addEvent(elm, evType, fn, useCapture){
		if (elm.addEventListener) {
			elm.addEventListener(evType, fn, useCapture);
			return true;
		} else if (elm.attachEvent) {
			var r = elm.attachEvent('on' + evType, fn);
			return r;
		} else {
			elm['on' + evType] = fn;
		}
	}
	
	addEvent(window, 'load', init, false);
-->