function clearDefaults(whichField,defaultValue) {
  // clear default text when field is focused:
  if (whichField.value == defaultValue) {
    whichField.value = "";
  }
}
//
function openPopup(popupLocation, popupName, popupWidth, popupHeight) {
  // set defaults if they can't be read
  var screenWidth = 760;
  var screenHeight = 420;
  if (self.screen.width) {
    screenWidth = self.screen.width;
    screenHeight = self.screen.height;
  }
  var popupTop = (screenHeight-popupHeight)/2;
  var popupLeft = (screenWidth-popupWidth)/2;
  popupName=window.open(popupLocation,popupName,'height='+popupHeight+',width='+popupWidth+',left='+popupLeft+',top='+popupTop+',resizable=1');
  if (window.focus) {
    popupName.focus();
  }
  return false;
}
//
function revealHidden() {
// reveal close window JS link if JS is active
  if (getElement('JSHidden')) {
    thiselement.style.display="block";
  }
}
//
function getElement(elementName) {
// thanks to http://www.netlobo.com/div_hiding.html
if (window.document.getElementById) {
	// this is the way the standards work
	thiselement = window.document.getElementById(elementName);
	return true;
	} else if (window.document.all) {
	// this is the way old msie versions work
	thiselement = window.document.all[elementName];
	return true;
	} else if (window.document.layers) {
	// this is the way nn4 works
	thiselement = window.document.layers[elementName];
	return true;
	}
	return false;
}

function warning()
{
	var missatge= "Are you sure that you want to delete this mail?";
	if(window.confirm(missatge)) { 
		return true;
	} else {
		return false;
	}


} 
