//  -------------------------------------------------
//  last update:26-nov-2007
//  some javascript function of general usage 
//  by marcello galli -mar-2005 
//  ---------------------------------------
//
//
//
function maketopbanner(toppath)
{
  var imagedir=toppath+'comuni/'
  //window.confirm(imagedir)
  var line1='<table width="100%" border=0 cellpadding=0 cellspacing=0 ><tr><td>'
  document.write(line1)
  maketoptitle(imagedir)
  var line2='</td></tr><tr><td> '
  document.write(line2)
  maketopmenu(toppath)
  var line3='</td></tr><tr><td> '
  document.write(line3)
}
function maketopmenu(toppath)
{
// inserts the top banner into a page  M.Galli may2007
// the argument toppath is the relative address of the top path of the web site,
// common images are kept in the dir: toppath/comuni

   var stylegg='style="background-color: rgb(255, 255, 255);font-size: 11px ; font-weight: bold ;"';
   var stylep='style="background-color: rgb(255, 255, 255);font-size: 9px ;"';
   var stylet='style=" border: 2px groove black ; margin-top: 0px ; margin-bottom:5px ; "' ;
   var topb='' ;
   topb+='<table '+stylet+' cellpadding="0" cellspacing="0"  width="100%" > ' ;
   topb+='<td ' + stylegg + ' ><a href="' + toppath + 'index.html">Home</a></td>' ;
   topb+='<td ' + stylegg + ' ><a href="' + toppath + 'T2/index.html">T2,our sponsor</a></td>' ;
   topb+='<td ' + stylegg + ' ><a href="' + toppath + 'marcello/index.html">Marcello:</a></td>' ;
   topb+='<td ' + stylep  + ' ><a href="' + toppath + 'marcello/didattica.html">Didattica</a></td>' ;
   topb+='<td ' + stylep  + ' ><a href="' + toppath + 'marcello/techblog/index.html">TechBlog</a></td>' ;
   topb+='<td ' + stylep  + ' ><a href="' + toppath + 'marcello/efeso/index.html">Karate</a></td>' ;
   topb+='<td ' + stylegg + ' ><a href="' + toppath + 'loretta/index.html">Loretta:</a></td>' ;
   topb+='<td ' + stylep  + ' ><a href="' + toppath + 'loretta/donbosco/index.html">Didattica</a></td>' ;
   topb+='<td ' + stylep  + ' ><a href="' + toppath + 'loretta/tutorials/index.html">Tutorials</a></td>' ;
   topb+='<td ' + stylep  + ' ><a href="' + toppath + 'loretta/cdrom/Documenti/index.html">Pianeti</a></td>' ;
   topb+='</tr> ' ;
   topb+='</table>' ;

   document.write(topb) ;
}

function maketoptitle(imagepath)
{ 
   var styled='style="background-color: rgb(255, 255, 255); border: 2px groove black ; margin-top: 0px ; margin-bottom:0px ; "' ;
   var logo=imagepath+'logo-50x50.png' 
   var titolo=imagepath+'titolo_150x50.png'
   var intestazione=imagepath+'intestazione-14.png'

   var linea='<table width="100%" '+styled+' align="right"  cellpadding="0" cellspacing="0" > <tr>' 
   linea+='<td align="left"><img src="'+logo+'" alt="helldragon.eu logo" >'
   linea+='<img src="'+titolo+'" alt="www.helldragon.eu" >'
   linea+='</td > <td align="right">'
   linea+='<img src="'+intestazione+'" alt="The personal site of Marcello,Loretta and Sons" >'
   linea+='</td ></tr></table>'
    //window.confirm(linea)
   document.write(linea) ;

}

function maketopbanner0(toppath)
{
// inserts the top banner into a page  M.Galli may2007
// the argument toppath is the relative address of the top path of the web site

   var stylegg='style="background-color: rgb(255, 255, 255);font-size: 11px ; font-weight: bold ;"';
   var stylep='style="background-color: rgb(255, 255, 255);font-size: 9px ;"';
   var stylet='style=" border: 2px groove black ; margin-top: 0px ; margin-bottom:5px ; "' ;
   /*var toppath='../' ;*/
   var topb='' ;
   //var topb='<hr>' ;   
   topb+='<table '+stylet+' cellpadding="0" cellspacing="0"  width="100%" > ' ;
   //topb+='<td > <img src="' + toppath + 'helldragon3-g-icon.png" alt="helldragon logo" width="10px" height="10"px>' ;
   topb+='<td ' + stylegg + ' ><a href="' + toppath + 'index.html">Home</a></td>' ;
   topb+='<td ' + stylegg + ' ><a href="' + toppath + 'T2/index.html">T2,our sponsor</a></td>' ;
   topb+='<td ' + stylegg + ' ><a href="' + toppath + 'marcello/index.html">Marcello:</a></td>' ;
   topb+='<td ' + stylep  + ' ><a href="' + toppath + 'marcello/didattica.html">Didattica</a></td>' ;
   topb+='<td ' + stylep  + ' ><a href="' + toppath + 'marcello/techblog/index.html">TechBlog</a></td>' ;
   topb+='<td ' + stylep  + ' ><a href="' + toppath + 'marcello/efeso/index.html">Karate</a></td>' ;
   topb+='<td ' + stylegg + ' ><a href="' + toppath + 'loretta/index.html">Loretta:</a></td>' ;
   topb+='<td ' + stylep  + ' ><a href="' + toppath + 'loretta/donbosco/index.html">Didattica</a></td>' ;
   topb+='<td ' + stylep  + ' ><a href="' + toppath + 'loretta/tutorials/index.html">Tutorials</a></td>' ;
   topb+='</tr> ' ;
   topb+='</table>' ;
   //topb+='<hr>' ;

   document.write(topb) ;
}

function languagemenu()
{
   // menu per andare a pagina corrispondente di un'altra lingua. 
   // Se il nome della pagina contiene: "_it" va alla pagina 
   // con nome che al posto di "_it" ha "_en" .
   // Viceversa se il nome ha "_en" va al file con "_it" nel nome 
   // m.galli , nov 2007 
   
   //cerca icone in dir definito da:
   //<SCRIPT language=javascript > topdir="./" ; comuni=topdir+"comuni/" ; </script>
   // che deve stare nella pagina html che chiama la funzione, provo a mettere defaults 
   
   if ( typeof topdir == 'undefined' ) topdir="./"
   if ( typeof comuni == 'undefined' ) comuni="./"
   
   var styleflag='style="font-size: 11px ;font-weight: bold ; color:blue"';

   // .... costruisce nome dell'altra pagina ed elementi del menu
 
  
   var pagurl=self.document.location ;
   var pagina=pagurl.toString(); 
   //window.confirm(pagina.length)
   
   
   if( pagina.indexOf("_it") != -1 )
   {
      var lingua="english" ;
      var messaggio=" English page " ;
      var icona=comuni+"gbflag.gif"  ; 
      var altrapagina=pagina.replace("_it","_en") ; 
   }
   else
   {
      if(pagina.indexOf("_en") != -1 )
      {
         var lingua="italiano" ;
         var messaggio=" Pagina Italiana " ;
         var icona=comuni+"itflag.gif"  ; 
         var altrapagina=pagina.replace("_en","_it") ; 
      }
      else
      {
         return false 
      }
   }
   
   // ..... scrive il menu 
   
   var linea='<div width="100%" '+styleflag+' align="right" > ' 
   linea+='<img src="'+icona+'" alt="'+lingua+'" >'
   linea+='<a href="'+altrapagina+'" > '
   linea+=messaggio
   linea+='</a></div> '
   //window.confirm(linea)
   document.write(linea) ;
}




function navbar(avanti,indietro,sopra)
{
//  makes a simple navigation bar  : 3 arrows between 2 HR eleemnts

  s=  '<HR>'
  s=s+'<CENTER><TABLE WIDTH="100%" >'
  s=s+'<TR>'
  s=s+'<TD ALIGN=justify DIR=rtl>'
  s=s+'<A HREF="'+indietro+'"><IMG SRC="indietro.gif" ALT="back" ALIGN=left WIDTH="14" HEIGHT="14"></A>'
  s=s+'<TD ALIGN=center >'
  s=s+'<A HREF="'+sopra+'"><IMG SRC="insu.gif" ALT="index" ALIGN=center WIDTH="14" HEIGHT="14"></A>'
  s=s+'<TD ALIGN=right>'
  s=s+'<A HREF="'+avanti+'"><IMG SRC="continua.gif" ALT="forward" ALIGN=right WIDTH="14" HEIGHT="14"></A>'
  s=s+'</TABLE></CENTER>'
  s=s+'<HR>'

  document.write(s) 

}
function navbarlast(indietro,sopra)
{
//  makes a simple navigation bar  for the last page  : 3 arrows between 2 HR eleemnts

  s=  '<HR>'
  s=s+'<CENTER><TABLE WIDTH="100%" >'
  s=s+'<TR>'
  s=s+'<TD ALIGN=justify DIR=rtl>'
  s=s+'<A HREF="'+indietro+'"><IMG SRC="indietro.gif" ALT="back" ALIGN=left WIDTH="14" HEIGHT="14"></A>'
  s=s+'<TD ALIGN=center >'
  s=s+'<A HREF="'+sopra+'"><IMG SRC="insu.gif" ALT="index" ALIGN=center WIDTH="14" HEIGHT="14"></A>'
  s=s+'<TD ALIGN=right>'
  s=s+'<A HREF="#"><IMG SRC="nocontinua.gif" ALT="no_next_page" ALIGN=right WIDTH="14" HEIGHT="14"></A>'
  s=s+'</TABLE></CENTER>'
  s=s+'<HR>'

  document.write(s) 

}
function navbarfirst(avanti,sopra)
{
//  makes a simple navigation bar for the first page  : 3 arrows between 2 HR eleemnts

  s=  '<HR>'
  s=s+'<CENTER><TABLE WIDTH="100%" >'
  s=s+'<TR>'
  s=s+'<TD ALIGN=justify DIR=rtl>'
  s=s+'<A HREF="#"><IMG SRC="noindietro.gif" ALT="no back page" ALIGN=left WIDTH="14" HEIGHT="14"></A>'
  s=s+'<TD ALIGN=center >'
  s=s+'<A HREF="'+sopra+'"><IMG SRC="insu.gif" ALT="index" ALIGN=center WIDTH="14" HEIGHT="14"></A>'
  s=s+'<TD ALIGN=right>'
  s=s+'<A HREF="'+avanti+'"><IMG SRC="continua.gif" ALT="forward" ALIGN=right WIDTH="14" HEIGHT="14"></A>'
  s=s+'</TABLE></CENTER>'
  s=s+'<HR>'

  document.write(s) 

}

function navbarfirst1(avanti,sopra)
{
//  makes a simple navigation bar for the first page, with a line and 3 arrows 
  s=''
  //s=  '<HR>'
  s=s+'<CENTER><TABLE WIDTH="100%" >'
  s=s+'<TR>'
  s=s+'<TD ALIGN=justify DIR=rtl WIDTH="14">'
  s=s+'<A HREF="#"><IMG SRC="noindietro.gif" ALT="no back page" ALIGN=left WIDTH="14" HEIGHT="14" border="0" ></A>'
  s=s+'<TD align="center" ><IMG SRC="barra_blu.gif" alt="separatore"  align="middle" width="100%" height="2"</TD>'
  s=s+'<TD ALIGN=center WIDTH="14" >'
  s=s+'<A HREF="'+sopra+'"><IMG SRC="insu.gif" ALT="index" ALIGN=center WIDTH="14" HEIGHT="14" border="0" ></A>'
  s=s+'<TD align="center" ><IMG SRC="barra_blu.gif" alt="separatore"  align="middle" width="100%" height="2"</TD>'
  s=s+'<TD ALIGN=right WIDTH="14">'
  s=s+'<A HREF="'+avanti+'"><IMG SRC="continua.gif" ALT="forward" ALIGN=right WIDTH="14" HEIGHT="14" border="0" ></A>'
  s=s+'</TABLE></CENTER>'
  //s=s+'<HR>'

  document.write(s) 

}

function navbar1(avanti,indietro,sopra)
{
//  makes a simple navigation bar , with a line and 3 arrows 
  s=''
  //s=  '<HR>'
  s=s+'<CENTER><TABLE WIDTH="100%" >'
  s=s+'<TR>'
  s=s+'<TD ALIGN=justify DIR=rtl WIDTH="14">'
  s=s+'<A HREF="'+indietro+'"><IMG SRC="indietro.gif" ALT="no back page" ALIGN=left WIDTH="14" HEIGHT="14" border="0" ></A>'
  s=s+'<TD align="center" ><IMG SRC="barra_blu.gif" alt="separatore"  align="middle" width="100%" height="2"</TD>'
  s=s+'<TD ALIGN=center WIDTH="14" >'
  s=s+'<A HREF="'+sopra+'"><IMG SRC="insu.gif" ALT="index" ALIGN=center WIDTH="14" HEIGHT="14" border="0" ></A>'
  s=s+'<TD align="center" ><IMG SRC="barra_blu.gif" alt="separatore"  align="middle" width="100%" height="2"</TD>'
  s=s+'<TD ALIGN=right WIDTH="14">'
  s=s+'<A HREF="'+avanti+'"><IMG SRC="continua.gif" ALT="forward" ALIGN=right WIDTH="14" HEIGHT="14" border="0" ></A>'
  s=s+'</TABLE></CENTER>'
  //s=s+'<HR>'

  document.write(s) 

}
function navbarlast1(indietro,sopra)
{
//  makes a simple navigation bar , with a line and 3 arrows 
  s=''
  //s=  '<HR>'
  s=s+'<CENTER><TABLE WIDTH="100%" >'
  s=s+'<TR>'
  s=s+'<TD ALIGN=justify DIR=rtl WIDTH="14">'
  s=s+'<A HREF="'+indietro+'"><IMG SRC="indietro.gif" ALT="no back page" ALIGN=left WIDTH="14" HEIGHT="14" border="0" ></A>'
  s=s+'<TD align="center" ><IMG SRC="barra_blu.gif" alt="separatore"  align="middle" width="100%" height="2"</TD>'
  s=s+'<TD ALIGN=center WIDTH="14" >'
  s=s+'<A HREF="'+sopra+'"><IMG SRC="insu.gif" ALT="index" ALIGN=center WIDTH="14" HEIGHT="14" border="0" ></A>'
  s=s+'<TD align="center" ><IMG SRC="barra_blu.gif" alt="separatore"  align="middle" width="100%" height="2"</TD>'
  s=s+'<TD ALIGN=right WIDTH="14">'
  s=s+'<A HREF="#"><IMG SRC="nocontinua.gif" ALT="forward" ALIGN=right WIDTH="14" HEIGHT="14" border="0" ></A>'
  s=s+'</TABLE></CENTER>'
  //s=s+'<HR>'

  document.write(s) 

}
function navbarup(sopra)
{
//  makes a simple navigation bar , with a line and 3 arrows 
  s=''
  //s=  '<HR>'
  s=s+'<CENTER><TABLE WIDTH="100%" >'
  s=s+'<TR>'
  s=s+'<TD ALIGN=justify DIR=rtl WIDTH="14">'
  s=s+'<A HREF="#"><IMG SRC="noindietro.gif" ALT="no back page" ALIGN=left WIDTH="14" HEIGHT="14" border="0" ></A>'
  s=s+'<TD align="center" ><IMG SRC="barra_blu.gif" alt="separatore"  align="middle" width="100%" height="2"</TD>'
  s=s+'<TD ALIGN=center WIDTH="14" >'
  s=s+'<A HREF="'+sopra+'"><IMG SRC="insu.gif" ALT="index" ALIGN=center WIDTH="14" HEIGHT="14" border="0" ></A>'
  s=s+'<TD align="center" ><IMG SRC="barra_blu.gif" alt="separatore"  align="middle" width="100%" height="2"</TD>'
  s=s+'<TD ALIGN=right WIDTH="14">'
  s=s+'<A HREF="#"><IMG SRC="nocontinua.gif" ALT="no forward page" ALIGN=right WIDTH="14" HEIGHT="14" border="0" ></A>'
  s=s+'</TABLE></CENTER>'
  //s=s+'<HR>'

  document.write(s) 

}

function popup(filehtml,nome)
{
//  apre una finestra grande, di nome: nome, con dentro filehtml,
 
 var stringa="resizable=yes,scrollbars=yes,alwaisRaised,toolbar=no,titlebar=no,status=yes,personalbar=no,menubar=no,location=no,width=600,height=500,screenX=0,screenY=0"
 
 var ww = window.open(filehtml,nome,stringa);
 ww.focus() ;                             
 return ww ;  

}
 
function footer(lastupdata)
{
//    mette, in fondo, il nome dell'autore, la data di ultimo aggiornamento
//    e la url della pagina

  s=  ' '

  s=s+'<HR><TABLE WIDTH="100%">'

  s=s+'<TR>'  
  s=s+'<TD ALIGN="left" >'
 
  s=s+'<SMALL><CITE>'
  s=s+' Helldragon.eu'
  s=s+' &copy;<A HREF="mailto:info@helldragon.eu"> Marcello, Loretta &amp; sons</A> - 2007 '
  s=s+'<BR>Last update: '+lastupdata  
  s=s+'</CITE></SMALL>'
  
  //s=s+'<TD ALIGN="center"><A href="../index.html"><IMG src="../insu.gif"> <br>To home <TD>'

  s=s+'<TD ALIGN="right">'
  s=s+'<SMALL><CITE>'  
  s=s+ document.URL; 
  s=s+'</CITE></SMALL>'

  s=s+'</TABLE></CENTER>'
  s=s+'<HR>'

  document.write(s) 

}

