function orologio() {
var time= new Date();
var giorno= time.getDate();
var mese = time.getMonth();
var anno = time.getFullYear();
var ora = time.getHours();
var min = time.getMinutes();
var sec = time.getSeconds();
var giornosett = time.getDay();
var tempo = " " + ora;
tempo+=((min<10) ?":0" : ":") + min;
tempo+=((sec<10) ?":0" : ":") + sec + ", ";

switch (giornosett) { 
  case 0: 
    tempo+="Domenica"; 
  break; 
  case 1: 
    tempo+="Lunedì"; 
  break; 
  case 2: 
    tempo+="Martedì"; 
  break; 
  case 3: 
    tempo+="Mercoledì"; 
  break; 
  case 4: 
    tempo+="Giovedì"; 
  break; 
  case 5: 
    tempo+="Venerdì"; 
  break; 
  case 6: 
    tempo+="Sabato"; 
  break; 
  default: 
    tempo+=""; 
}

tempo+=((giorno<10) ?" 0" : " ") + giorno + " ";

switch (mese) { 
  case 0: 
    tempo+="Gennaio"; 
  break; 
  case 1: 
    tempo+="Febbraio"; 
  break; 
  case 2: 
    tempo+="Marzo"; 
  break; 
  case 3: 
    tempo+="Aprile"; 
  break; 
  case 4: 
    tempo+="Maggio"; 
  break; 
  case 5: 
    tempo+="Giugno"; 
  break; 
  case 6: 
    tempo+="Luglio"; 
  break; 
  case 7: 
    tempo+="Agosto"; 
  break; 
  case 8: 
    tempo+="Settembre"; 
  break; 
  case 9: 
    tempo+="Ottobre"; 
  break; 
  case 10: 
    tempo+="Novembre"; 
  break; 
  case 11: 
    tempo+="Dicembre"; 
  break; 

  default: 
    tempo+=""; 
}

tempo+=" " + (anno);

if (ora >6 && ora<14) {tempo+=". Buon giorno."}
else if (ora >=14 && ora<18) {tempo+=". Buon pomeriggio."}
else if (ora >=18 && ora<23) {tempo+=". Buona sera."}
else tempo+= ". Buona notte.";

var el = document.getElementById("datetime");
el.innerHTML = tempo;
}

var http = getHTTPObject();

function getHTTPObject() {
    var xmlhttp;
    if (window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest();
    } else if (window.ActiveXObject) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    } 
    return xmlhttp;
}

function loadpage(pagina) 
{
	location.href=pagina;
/*
	http.open("GET", pagina, true);
    http.onreadystatechange = popDivContent;
    http.send(null);
*/
}

function popDivContent() {
var el = document.getElementById("contenttext");
	if ( http.readyState == 4 ) {
  		if ( http.status == 200 ) {
            el.innerHTML = http.responseText;
        } 
    }
    
}

function addbookmark(title, url)
{
	if (document.all)
		window.external.AddFavorite(url, title);
	else if (window.sidebar)
		window.sidebar.addPanel(title, url, "")
}

function disableRightClick(e)
{
  var message = "Copyright 2008 Wise Ingegneria e Soluzioni Software";

  if(!document.rightClickDisabled) // initialize
  {
    if(document.layers)
    {
      document.captureEvents(Event.MOUSEDOWN);
      document.onmousedown = disableRightClick;
    }
    else document.oncontextmenu = disableRightClick;
    return document.rightClickDisabled = true;
  }
  if(document.layers || (document.getElementById && !document.all))
  {
    if (e.which==2||e.which==3)
    {
      alert(message);
      return false;
    }
  }
  else
  {
    alert(message);
    return false;
  }
}

function $(o) {return document.getElementById(o);}
function toggle(o) {
  var subitem = o.nextSibling;
 
  while (subitem.className != 'subitem') {
    if (!subitem) return false;
    subitem = subitem.nextSibling;
  }
 
  if (subitem.style && subitem.style.display == 'block') {
    subitem.style.display = 'none';
    o.style.background = "url('img/tree-plus.gif') no-repeat left";
  } else {
    subitem.style.display = 'block';
    o.style.background = "url('img/tree-minus.gif') no-repeat left";
  }
  return false;
}

// Funzione per visualizzare percorso nelle singole pagine
function breadCrumbs($home_directory, $divider1, $divider2, $cStyle, $tStyle, $dStyle, $new_line) { 

$location = window.location.toString(); 
$subString = $location.substr($location.indexOf($home_directory) + $home_directory.length + 1).split("/"); 

document.write("<a href=\"" + getLoc($subString.length - 1)+ "\" class=\"" + $cStyle + "\">Home</a> " + "<span class=\"" + $dStyle + "\">" + $divider1 + "</span> "); 

$a = ($location.indexOf() == -1) ? 1 : 2; 
for (i = 0; i < $subString.length - $a; i++) { 
$subString[i] = makeCaps(unescape($subString[i])); 

document.write("<a href=\"" + getLoc($subString.length - i - 2) + "\" class=\"" + $cStyle + "\">" + $subString[i] + "</a> " + "<span class=\"" + $dStyle + "\">" + $divider2 + "</span> "); 
} 

if ($new_line == 1) { 
document.write("<br>"); 
} 
document.write("<span class=\"" + $tStyle + "\">" + document.title + "</span>"); 
}
function makeCaps($a) { 
$sub_dir_name = $a.split(" "); 

for (l = 0; l < $sub_dir_name.length; l++) { 
$sub_dir_name[l] = $sub_dir_name[l].toUpperCase().slice(0, 1) + $sub_dir_name[l].slice(1); 
} 
return $sub_dir_name.join(" "); 
}
function getLoc($num) { 
var $path = ""; 
if ($num > 0) { 
for ($count = 0; $count < $num; $count++) { 
$path = $path + "../"; 
} 
} 
return $path;
}

function visProp( what ){  
var elem, info, whichLayer; 
    whichLayer = 'boxinfo2'; 
	if( document.getElementById ) // this is the way the standards work    
		elem = document.getElementById( whichLayer );  
	else if( document.all ) // this is the way old msie versions work      
		elem = document.all[whichLayer];  
	else if( document.layers ) // this is the way nn4 works    
		elem = document.layers[whichLayer];  

    switch (what) { 
  		case 1: 
    		info = "Gestione utenti e ruoli.<br>Accessi differenziati e configurabili in funzione dei ruoli.<br>L'accesso ai programmi generati avviene tramite riconoscimento di utenti e password."; 
  		break; 
  		case 2: 
    		info = "Possibilità di scegliere l'operatore di confronto ( =, >, >=,<, <=, <>, NULL, compreso, esterno, ecc...)  per ogni dato visualizzato.<br>Interrogazioni in AND ed in OR sui dati.<br>Ordinamenti.<br>Funzioni di raggruppamento configurabili."; 
  		break; 
  		case 3: 
    		info = "Possibilità di configurare menù di contesto (popup menù) per l'inserimento, la modifica o la cancellazione di un dato o la chiamata di una stored procedure"; 
  		break; 
  		case 4: 
    		info = "Possibilità di inviare e ricevere messaggi tra gli utenti dei programmi generati tramite W-ALL.<br>E' inoltre possibile configurare i destinatari degli avvisi generati da eventi di sistema."; 
  		break; 
  		case 5: 
    		info = "Possibilità di configurare comandi SQL ed esecuzioni di stored-procedure con la periodicità desiderata."; 
  		break; 

  		default: 
    		info = ""; 
}
    elem.innerHTML = info;
	elem.style.visibility = 'visible';
}

