
function controlla_inserimento(usr,psw){
	if ((usr == "") || (psw == "")){
		alert("Eseguire il Login inserendo Username e Password");
		return false;
	}
	else{
		return true;
	}
}

function SwitchMenu(obj)
{
	if(document.getElementById)
	{
		var el = document.getElementById(obj);
		var ar = document.getElementById("masterdiv").getElementsByTagName("span");
		if(el.style.display != "block")
		{
			for (var i=0; i<ar.length; i++)
			{
				if (ar[i].className=="spanAreaInside")
				ar[i].style.display = "none";
			}
			el.style.display = "block";
		}
		else
		{
			el.style.display = "none";
		}
	}
}

function poponclick(pagpopup, sb, w, h )
{
//	if (w == 0){ w = 630}
//	if (h == 0){ h = 330}
	if (w == 0){ w = 740}
	if (h == 0){ h = 490}
	mywindow = window.open(pagpopup, "popup","menubar=0,toolbar=0,directories=0,resizable=0,location=0,status=0,scrollbars="+sb+",width="+w+",height="+h+",left=40,top=40");
	mywindow.focus();
}

function poponclickLink(pagpopup,larghezza,altezza)
{
	mywindow = window.open(pagpopup, "popup","menubar=1,toolbar=1,directories=1,resizable=1,location=1,status=1,scrollbars=1,width="+larghezza+",height="+altezza+",left=100,top=100");
	mywindow.focus();
}

function showbox(objcurr, txt){
	if(document.getElementById){
	
		objbox = document.getElementById("box")
		objbox.innerHTML = txt
		
        //objbox.style.height=objcurr.style.height
		objbox.style.height=50
		objbox.style.width=450
        //objbox.style.left=parseInt(objcurr.offsetLeft+objcurr.offsetWidth+10)
		objbox.style.visibility = "visible"
		move_box(objcurr, objbox)
	}
}

function hidebox(){
	if(document.getElementById){
		objbox.style.visibility="hidden"
    }
}

function move_box(an, box) {
  var cleft = 0;
  var ctop = 0;
  var obj = an;
  while (obj.offsetParent) {
    cleft += obj.offsetLeft;
    ctop += obj.offsetTop;
    obj = obj.offsetParent;
  }
  box.style.left = cleft + 'px';
  ctop += an.offsetHeight + 8;
  if (document.body.currentStyle &&
    document.body.currentStyle['marginTop']) {
    ctop += parseInt(
      document.body.currentStyle['marginTop']);
  }
  box.style.top = ctop + 'px';
}




