//<!--

defaultStatus = "Ifmsa (DiPASSI) - WebLab";
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 += " (The link new window opens one)";
		              if (!anchor.title) anchor.title = "The link new window opens one";
	            }
         }
}

// 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;
 
     }
     
window.onload = function() {
	externalLinks(); // Per i links, vedi sopra.
	gelatina();
}
window.onresize = function() { gelatina(); }

// popup windows
var win = null;
function NewWindow(myurl,myname,w,h,scroll){
	LeftPosition = (screen.width) ? (screen.width-w)/22 : 0;
	TopPosition = (screen.height) ? (screen.height-h)/16 : 0;
	settings ='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable'
	win = window.open(myurl,myname,settings)
	if(win.window.focus){win.window.focus();}
}

//-->

