<!--
//javascript functions for http://www.spacemarc.it

//inserisce l'home page tra i preferiti
function preferiti(title,url) { 
if (window.sidebar) { 
window.sidebar.addPanel(title, url,""); 
} else if( document.all ) { 
window.external.AddFavorite( url, title); 
} else if( window.opera && window.print ) {
return true; 
} 
}

//pulisce il campo del motore interno
function deletetext(elm){
	if (!elm.base) elm.base = elm.value
	if (elm.value == elm.base) elm.value = "";
	else if (elm.value == "") elm.value = elm.base;
}

//controlla se c'è una parola nel campo del motore interno
function isBlank() {
value=document.search_form.elements['sp-q'].value;
if ( value == "cerca nel sito" ){
         alert("Inserisci un termine da cercare");
         return false;
     }
     else {
     return true;
     }
}

//aggiunge il plugin tra i motori di ricerca di Firefox, Mozilla e Netscape
function addEngine(name,ext,cat,type) {
if ((typeof window.sidebar == "object") && (typeof window.sidebar.addSearchEngine == "function"))
{
window.sidebar.addSearchEngine("http://mycroft.mozdev.org/install.php/"+type+"/"+name+".src",
"http://mycroft.mozdev.org/install.php/"+type+"/"+name+"."+ext, name, cat);
}
else
{
alert("I plugins di ricerca sono installabili solo su Firefox, Netscape e Mozilla Suite");
}
}

//conta i caratteri massimi per invio SMS
var maxchars=147;

function CheckLength()
  {
  with (document.sms)
    {
    chars=smstext.value
    if (chars.length > maxchars)
      {
      smstext.value=chars.substr(0,maxchars);
      smstext.blur();
      }
    left.value=maxchars-smstext.value.length;
    }
  }

//cambia i valori dei chmod nel tutorial
function calcperm() { 
document.fmode.u.value = 0; 
if (document.fmode.ur.checked) { 
document.fmode.u.value = document.fmode.u.value * 1 + document.fmode.ur.value * 1; 
} 
if (document.fmode.uw.checked) { 
document.fmode.u.value = document.fmode.u.value * 1 + document.fmode.uw.value * 1; 
} 
if (document.fmode.ux.checked) { 
document.fmode.u.value = document.fmode.u.value * 1 + document.fmode.ux.value * 1; 
} 
document.fmode.g.value = 0; 
if (document.fmode.gr.checked) { 
document.fmode.g.value = document.fmode.g.value * 1 + document.fmode.gr.value * 1; 
} 
if (document.fmode.gw.checked) { 
document.fmode.g.value = document.fmode.g.value * 1 + document.fmode.gw.value * 1; 
} 
if (document.fmode.gx.checked) { 
document.fmode.g.value = document.fmode.g.value * 1 + document.fmode.gx.value * 1; 
} 
document.fmode.w.value = 0; 
if (document.fmode.wr.checked) { 
document.fmode.w.value = document.fmode.w.value * 1 + document.fmode.wr.value * 1; 
} 
if (document.fmode.ww.checked) { 
document.fmode.w.value = document.fmode.w.value * 1 + document.fmode.ww.value * 1; 
} 
if (document.fmode.wx.checked) { 
document.fmode.w.value = document.fmode.w.value * 1 + document.fmode.wx.value * 1; 
} 
}

-->
