/*<![CDATA[*/
//<!--

defaultStatus = "StilisticaMente";
if (parent != self)
top.location.href = location.href;

/* Original:  Eric King (eric_andrew_king@hotmail.com) 
   Web Site:  http://redrival.com/eak/

   This script and many more are available free online at
   The JavaScript Source!! http://javascript.internet.com

   Begin */
function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;  // divide per due la larghezza dello schermo.
var wint = (screen.height - h) / 3; // divide per tre l'altezza dello schermo.
winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); } // Se previsto dal browser, gestisce il focus.
}

// Sostituisce l'argomento target delle ancore, che in xhml non è previsto.
function externalLinks() {
         if (!document.getElementsByTagName) return;
         var anchors = document.getElementsByTagName("a");
         for (var i=0; i<anchors.length; i++) {
	            var anchor = anchors[i];
		    // Versione italiana.
	            if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "esterno") {
		              anchor.target = "_blank";
		              if (anchor.title) anchor.title += " (Il link apre una nuova finestra)";
		              if (!anchor.title) anchor.title = "Il link apre una nuova finestra";
	            }
		    // Versione inglese.
		    if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
		              anchor.target = "_blank";
		              if (anchor.title) anchor.title += " (Il link apre una nuova finestra in inglese)";
		              if (!anchor.title) anchor.title = "Il link apre una nuova finestra in inglese";
	            }
         }
}

// gelatina transformers
// versione 1.0
// idea per il forum di diodati.org
// implementazione e tecnica di Luca Mascaro
// rilasciata sotto licenza http://creativecommons.org/licenses/by-nd-nc/1.0/

function gelatina() {
 		var index;
		if (self.innerHeight) { index = self.innerWidth; }
		else if (document.documentElement && document.documentElement.clientHeight) { index = document.documentElement.clientWidth; }
		else if (document.body) { index = document.body.clientWidth; }
		index = index/60;
		value = "0 "+index+"% 0 "+index+"%";
		document.getElementsByTagName("Body").item(0).style.padding = value;
 
		}
		
// nasconde il layer.
function getObj(elemento) {
          if (document.getElementById) {
              this.obj = document.getElementById(elemento);
              this.style = document.getElementById(elemento).style;
          }
          else if (document.all) {
                	this.obj = document.all[elemento];
                	this.style = document.all[elemento].style;
          } else if (document.layers) {
                    	this.obj = getObjNN4(document,elemento);
                     	this.style = this.obj;
          }
}
function getObjNN4(obj,elemento) {
      	var x = obj.layers;
     	var foundLayer;
        	for (var i=0;i<x.length;i++) {
        		if (x[i].id == elemento) foundLayer = x[i];
        		else if (x[i].layers.length)
    			var tmp = getObjNN4(x[i],elemento);
	         	if (tmp) foundLayer = tmp;
	        }
return foundLayer;
}
function nascondimi() {
    	var y = new getObj('nascosto');
	    y.style.visibility = 'hidden';
	    location.href = '#contenitore';
}
     
window.onload = function() {
	externalLinks(); // Per i links, vedi sopra.
	gelatina();
}
window.onresize = function() { gelatina(); }
//-->
/*]]>*/

