function MM_openBrWindow(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

function resetField(element)
{

	if(element.value.length==0){
		element.value="Cerca...";
	}
}

function clearField(element)
{
	if( element.value=="Cerca...")
	{
		element.value="";
	}
}
function MM_openBrWindow(theURL,winName,features)
{
	window.open(theURL,winName,features);
}

function resetField(element)
{

	if(element.value.length==0){
		element.value="Cerca...";
	}
}

function clearField(element)
{
	if( element.value=="Cerca...")
	{
		element.value="";
	}
}


function showTabOn(tabId)
{
	document.getElementById(tabId+'_li').className = tabId+'_tabs_on';
	document.getElementById(tabId+'_div').style.display = 'block';
}

function showTabOff(tabOff)
{
	document.getElementById(tabOff+'_li').className = tabOff+'_tabs_off';
	document.getElementById(tabOff+'_div').style.display = 'none';
}

function centerElement(referenceID, theID) 
{
  infohost = document.getElementById(referenceID);
  infobox = document.getElementById(theID);
  var infohostY = 0;
  var infohostX = 0;
  var count = 0;
  var infohostFind = infohost;
  do 
  {
    infohostY += infohostFind.offsetTop;
    infohostX += infohostFind.offsetLeft;
  } while ( infohostFind = infohostFind.offsetParent )
  infobox.style.left = (infohostX - ((infobox.offsetWidth - infohost.offsetWidth) / 2)+0) + 'px';
  infobox.style.top = infohostY + (infohost.offsetHeight / 2) + 8 + 'px';  
  return;
}

function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}
