// Affichage d'une url dans un popup centré à l'écran
function affichePopupUrl(urlPopup, nomInterne, largeurPopup, hauteurPopup) {
	hauteurPosition = (screen.availHeight - hauteurPopup) / 2;
	largeurPosition = (screen.availWidth - largeurPopup) / 2;
	window.open(urlPopup, nomInterne, 'height='+hauteurPopup+', width='+largeurPopup+', left='+largeurPosition+', top='+hauteurPosition+', toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, directories=no, status=no')
}


// Affichage / masquage de bloc html
function affichageBlocId(baliseId) {
	if (document.getElementById && document.getElementById(baliseId) != null) {
  	if(document.getElementById(baliseId).style.visibility == "hidden")
			afficheId(baliseId);
		else
			cacheId(baliseId);
  }
}

function afficheId(baliseId) {
	if (document.getElementById && document.getElementById(baliseId) != null) {
  	document.getElementById(baliseId).style.visibility="visible";
  	document.getElementById(baliseId).style.display="";
  }
}

function cacheId(baliseId) {
  if (document.getElementById && document.getElementById(baliseId) != null) {
    document.getElementById(baliseId).style.visibility="hidden";
    document.getElementById(baliseId).style.display="none";
  }
}

function htmlEntities(wText){
	if(typeof(wText)!="string")
		wText=wText.toString();

	wText=wText.replace(/&/g, "&amp;");
	wText=wText.replace(/"/g, "&quot;");
	wText=wText.replace(/</g, "&lt;");
	wText=wText.replace(/>/g, "&gt;");
	wText=wText.replace(/'/g, "&#039;");
	return wText;
}

