// Qui sotto imposta rispettivamente il tipo di carattere delle scritte, le dimensioni
// in punti ed il colore in formato esadecimale - --ATTENZIONE ALLA SINTASSI !-

stile = "<span style='font-family:verdana; font-size: 8; color: #3333FF'>";
elits = "</span>";

// Qui sotto scrivi i tuoi messaggi. Puoi usare testo lineare oppure usare i tag HTML:
// se vuoi inserire un titolo, racchiudilo tra i tag da <H1> a <H5> e relativi tag di 
// chiusura da </H1> a </H5>, se vuoi forzare il testo ad andare a capo, usa il
// tag <BR> che non ha tag di chiusura. Puoi scrivere tutto il testo anche utilizzando 
// la riga mex1, l'importante è che tu non vada mai a capo con il tasto INVIO e che 
// lasci le altre righe con le sole virgolette.

mex1 =
"<iframe name='frm_commento' src='Home/commento.html' allowtransparency='true' frameborder='0' "+
" height='600' scrolling='auto' width='600'>";

mex2 =
"<iframe name='frm_pagelle' src='Home/pagelle.html' allowtransparency='true' frameborder='0' "+
" height='600' scrolling='auto' width='600'>";

mex3 =
"<iframe name='frm_pagelle' src='Home/statistiche.html' allowtransparency='true' frameborder='0' "+
" height='300' scrolling='auto' width='500'>";

// Qui sotto imposta il colore di sfondo della barra del titolo in formato esadecimale

titlecolor = "#C0C0C0"; 

// Qui sotto imposta la trasparenza in valore percentuale da 0 a 100.
// A valore più basso corrisponde maggior trasparenza.

opacitytitle = 100;  

// Questa è l'immagine del pulsante di chiusura del popup

var closebutton = "Immagini/close.gif"; 

// Qui puoi posizionare il layer alla sua apertura.
// Indica rispettivamente la distanza in pixels 
// dal bordo sinistro e dal bordo superiore.

sinistro = "0";
superiore = "0"; 


// QUI NON TOCCARE NULLA!
var raampje, xtra, ytra, parole;
function sleepen(cosa, evt)
{
if (evt.button!=1)return;
if (cosa == 1){	
raampje = document.getElementById("commento");}
if (cosa == 2){	
raampje = document.getElementById("pagelle");}
if (cosa == 3){	
raampje = document.getElementById("statistiche");}
temp1=raampje.style.posLeft;
temp2=raampje.style.posTop;
xpos=event.clientX;
ypos=event.clientY;
xtra = temp1-xpos;
ytra = temp2-ypos;
document.onmousemove=plaats;
}

function plaats()
{
if (event.button==1){
raampje.style.pixelLeft=event.clientX+xtra;
raampje.style.pixelTop=event.clientY+ytra;return false;}
}

function raam(inside, cosa, color,width,height, background)
{						
var thisspan;
if (cosa == 1){
thisspan = document.getElementById("commento").style;}
if (cosa == 2){
thisspan = document.getElementById("pagelle").style;}
if (cosa == 3){
thisspan = document.getElementById("statistiche").style;}
thisspan.pixelLeft = document.body.scrollLeft + sinistro;		
thisspan.pixelTop =  document.body.scrollTop + superiore;
thisspan.visibility="visible";
parole = document.getElementById("scritta").style;
parole.visibility="hidden";

// titolo della finestra
if (cosa == 1){
titolo = "<font color='#000000' face='Verdana' size='2'><center>Commento</center></font>";}
if (cosa == 2){
titolo = "<font color='#000000' face='Verdana' size='2'><center>Pagelle</center></font>";}
if (cosa == 3){
titolo = "<font color='#000000' face='Verdana' size='2'><center>Statistiche</center></font>";}

// Qui sotto imposta la larghezza che deve avere il popup in pixels

if (cosa == 1){
larghezza = "600";}
if (cosa == 2){
larghezza = "600";}
if (cosa == 3){
larghezza = "500";}

// e qui sotto imposta l'altezza minima. Se il valore sarà insufficiente
// al contenuto del layer, l'altezza si dimensionerà in maniera tale 
// da mostrare comunque tutto il testo presente.

if (cosa == 1){
altezza = "600";}
if (cosa == 2){
altezza = "600";}
if (cosa == 3){
altezza = "300";}

// Qui indica, se vuoi, un'immagine di sfondo per il layer e relativo percorso

background ="";

// Qui indica, in formato esadecimale, il colore di sfondo del layer.
// In presenza di un'immagine di sfondo, questo valore verrà ignorato.

color ="#FFFFFF";

// DA QUI IN AVANTI NON TOCCARE PIU' NULLA
output = "<table cellpadding=0 cellspacing=0 width=" + larghezza + " height=" + altezza + " border=3><tr>";
output += "<td onmousedown='sleepen("+cosa+",event)' style='cursor:pointer' onmouseup='JavaScript:document.onmousemove=\"\" ' bgcolor='"+titlecolor+"' style='filter:alpha(opacity="+opacitytitle+");' width =" + larghezza + " height=20>" + titolo + "</td><td bgcolor='silver'>";
output += "<input type='image' alt=\"Close\" onclick='closeraam("+cosa+")' src='"+closebutton+"'></td></tr>";
output += "<tr><td width=100% colspan=2><table ";   
if(background)output += "style='background-image:url(\" " + background + "\")'";
output += " width=100% height=100% bgcolor='"+color+"'><tr><td height=100% width=100% >"+ inside+"</td></tr></table></td></tr>";
if (cosa == 1){
document.getElementById("commento").innerHTML = output;}
if (cosa == 2){
document.getElementById("pagelle").innerHTML = output;}
if (cosa == 3){
document.getElementById("statistiche").innerHTML = output;}
}

function closeraam(cosa)
{
if (cosa == 1){
document.getElementById("commento").style.visibility="hidden";}
if (cosa == 2){
document.getElementById("pagelle").style.visibility="hidden";}
if (cosa == 3){
document.getElementById("statistiche").style.visibility="hidden";}
parole.visibility="visible";
}

function fultimagara(cosa)
{
outp = "";
if (cosa == 1) {
outp +=stile+mex1+elits;}
if (cosa == 2) {
outp +=stile+mex2+elits;}
if (cosa == 3) {
outp +=stile+mex3+elits;}
raam(outp, cosa);
}
