  //function show2(){show2();}

	function logIt(){
		var form = document.loginForm;
		var controllo ="";
		if(isEmpty(form.username.value) || isEmpty(form.password.value))
			controllo="Inserire username e password";
		
		if(controllo=="")
			form.submit();
		else
			alert("Attenzione\n\n"+controllo);	
	}
			
  function viewCaricamento(){
    if (document.getElementById('attenderePrego')!=null)
      document.getElementById('attenderePrego').style.visibility="";
  }

  function returnBack(){
     viewCaricamento();
     backForm.submit();
  }

  var tempColor;

  function overRow(obj){
       var cells = obj.getElementsByTagName('td');

       for (var i=0; i<cells.length; i++){
         if(cells[i].id!="grafic"){
            tempColor=cells[i].bgColor;
            cells[i].bgColor='#E3FABC';
         }
       }
  }

  function outRow(obj){
       var cells = obj.getElementsByTagName('td');

       for (var i=0; i<cells.length; i++)
         if(cells[i].id!="grafic")
            cells[i].bgColor=tempColor;
  }
 
  function isEmpty(value) {

      if (value == null || value.length == 0)
        return true;
      for (var count = 0; count < value.length; count++) {
        if (value.charAt(count) != " ") return false;
      }
      return true;
  }

  function isArray(a) {
      return isObject(a) && a.constructor == Array;
  }

  function isObject(a) {
      return (a && typeof a == 'object') || isFunction(a);
  }

  function openTablet(tabletName) {
    document.forms["openTablet"+tabletName].submit();
  }

  function openDefaultPopUp(formName) {
    var height=600;
    var width=600;
    var win=window.open(  '',
              formName,
              'location=no, menubar=no, status=no, scrollbars=yes');
    var form = document.forms[formName];
    form.target=formName;
    win.resizeTo(width,height);
    win.focus();
    form.submit();
  }

  function openPopUp(formName,width,height) {
    width = width!=null ? width : 550;
    height = height!=null ? height : 600;
    var win=window.open(  '',formName,'location=no, menubar=no, status=no, scrollbars=yes');
    var form = document.forms[formName];
    form.target=formName;
    win.resizeTo(width,height);
    win.focus();
    form.submit();
  }

  function evidenzia(formElement) {
    formElement.style.borderColor="red";
    formElement.style.borderWidth="3px";
  }

  function ripristina(formElement) {
    formElement.style.borderColor="black";
    formElement.style.borderWidth="1px";
  }

  function checkDiritti() {
    if(diritti=="RW") {
      return true;
    } else {
      alert("Attenzione, non si possiedono i diritti per eseguire l'operazione. \nContattare l'amministratore.");
      return false;
    }
  }

  function openGuidaManager() {
      openDefaultPopUp("openGuidaManager");
  }
  
  function alertManutenzione(ret){
  		alert ("Di Bella Insieme è in fase di aggiornamento !"+
  		"\n\n Al più presto sarà di nuovo possibile registrarsi e scrivere sul blog.\n\n Ci scusiamo per il disagio.");
  		if (ret)
  			return false;
  }


