var seltext = ""
var repltext = ""
var testo = "" 

var fontSize= 100;
var largh= 100;
var w=100;
function leggi()
{  
   if (navigator.appName.indexOf("Netscape")>=0)
   {
     var selectedHtml=document.getSelection();
   }
   else
   {
     var selectedHtml=(document.selection.createRange()).htmlText;
   }
   newwindow=window.open('prova.php?testo='+selectedHtml,'name');

}

function favoriti()
{  

   if (navigator.appName.indexOf("Netscape")>=0)
   {
       alert('Per aggiungere il link ai preferiti: clicca  [ Ctrl + D ]  ');
   }
   else
   {
     window.external.AddFavorite(location.href, document.title);
   }

}

function grande()
{
	fontSize+=10;
  	document.getElementById("x100perc").style.fontSize=fontSize+'%';
}

function piccolo()
{
  fontSize-=10;
  document.getElementById("x100perc").style.fontSize=fontSize+'%';
}

function ripristina()
{
  fontSize=100;
  document.getElementById("x100perc").style.fontSize=fontSize+'%';
}

function stringi()
{
  largh-=10;
  document.getElementById("x100perc").style.width=largh+'%';
}

function allarga()
{
  largh+=10;
  if(largh <= 100)
  {
  document.getElementById("x100perc").style.width=largh+'%';
  }
  else
  {
   alert('È stata raggiunta la larghezza massima');
  }
}

function res()
{
if (parseInt(navigator.appVersion)>3) {
 if (navigator.appName=="Netscape") {
  winW = window.innerWidth;
  winH = window.innerHeight;
 }
 if (navigator.appName.indexOf("Microsoft")!=-1) {
  winW = document.body.offsetWidth;
  winH = document.body.offsetHeight;
 }

 if(winW==800)
 {
    document.getElementById("bod").style.margin='0px 5px';
 }

 if(winW==1024)
 {
    document.getElementById("bod").style.margin='0px 8%';
 }
}
}

function otto()
{
  document.getElementById("bod").style.margin='0px 5px';
}

function apri(variab)
{
  var winl = (screen.width - 450) / 2;
  var wint = (screen.height - 200) / 2;
  //var winprops='';
  //winprops = 'height=200,width=450,top='+wint+',left='+winl+'resizable=0,scrollbars=yes,status=no';

  var nota=escape(variab) ;
  var spazio= "@";
  var prova = '';
  var conta=1;
  while (nota.indexOf(spazio) > -1)
   {
        if(conta%10==0)
        {
        var pos= nota.indexOf(spazio);
        nota=nota.replace(spazio ,"");
        }

        conta++;
   }
  prova = window.open('archivio/note.php?note='+nota, "prova", 'height=200,width=450,top='+wint+',left='+winl+'resizable=0,scrollbars=yes,status=no');
      if(!(prova.closed))
      {
           prova.focus();
      }
}

