function contact() {window.open('/ecrireContactWebmaster.do','','toolbars=no,menubar=no,width=600,height=280');}

function changeProfile() {window.open('/changeProfile.do','','toolbars=no,menubar=no,width=450, height=370');}

function login() {window.open('/login.jsp','','toolbars=no,menubar=no,width=330,height=300');}

function escapeVal(textarea,replaceWith){
textarea.value=escape(textarea.value);
for(i=0; i<textarea.value.length; i++){
 	if(textarea.value.indexOf("%0D%0A") > -1){
	textarea.value=textarea.value.replace("%0D%0A",replaceWith)
	}
	else if(textarea.value.indexOf("%0A") > -1){
	textarea.value=textarea.value.replace("%0A",replaceWith)
	}
	else if(textarea.value.indexOf("%0D") > -1){
	textarea.value=textarea.value.replace("%0D",replaceWith)
	}
}
textarea.value=unescape(textarea.value);
}

function flashWait() {
	if(document.getElementById('thingToHide')){
		document.getElementById('thingToHide').className = "invisible";
	}else{
		alert("veuillez patienter pendant le rechargement de la page SVP");
	}
	if(document.getElementById('thingToShow')){
		document.getElementById('thingToShow').className = "visible";
	}
}

function flashUnWait() {
	if(document.getElementById('thingToHide')){
		document.getElementById('thingToHide').className = "visible";
	}
	if(document.getElementById('thingToShow')){
		document.getElementById('thingToShow').className = "invisible";
	}
}


/* START navigation */
function closeWindow(confirmation){
		if (confirmation == 'confirmation'){
		Check = confirm("Veuillez confirmer la fermeture de la fenêtre SVP.");
		if(Check == true) window.close();
		}
		else{
		window.close();
		}
		
}
function refreshWindow() {window.location.reload(false);}
function backWindow(){history.back();}
/* END navigation */

/* START resize window */
var normalWidth;
var normalHeight;

function initWindowSize(){
HM_IE = (document.all) ? true : false;
normalWidth = HM_IE ? document.body.clientWidth : window.outerWidth;
normalHeight = HM_IE ? document.body.clientHeight : window.outerHeight;
}

function normalWindow(normalWidth,normalHeight){	
var h = normalWidth; // hauteur de la popup
var l = normalHeight; // largeur de la popup
var PosX = ( screen.availWidth - h ) / 2; 
var PosY = ( screen.availHeight - l ) / 2; 
window.resizeTo(normalWidth,normalHeight);
moveTo(PosX, PosY);
}

function centerWindow(url,width,height,resize){
var h = width; // hauteur de la popup
var l = height; // largeur de la popup
if (resize == "no"){resize = "no"}else{resize == "yes"}
var PosX = ( screen.availWidth - h ) / 2; 
var PosY = ( screen.availHeight - l ) / 2; 
var option = "resizable="+resize+",top="+PosY+",left="+PosX+",width="+h+",height="+l+",scrollbars=yes,status=no,location=no,toolbar=no,directories=no,menubar=no"; 
window.open(url,"",option);
}

function initPopupSize(width,height){
	normalWidth = width; 
	normalHeight = height; 
	ScreenWidth = screen.width;
	ScreenHeight = screen.height;
	myPosX = ScreenWidth/2 - normalWidth/2;
	myPosY = ScreenHeight/2 - normalHeight/2;
	window.resizeTo(normalWidth,normalHeight);	
	window.moveTo(myPosX,myPosY);
}

function initPopup(){
	HM_IE = (document.all) ? true : false;
	normalWidth = HM_IE ? document.body.clientWidth : window.outerWidth;
	normalHeight = HM_IE ? document.body.clientHeight : window.outerHeight;
	ScreenWidth = screen.width;
	ScreenHeight = screen.height;
	myPosX = ScreenWidth/2 - normalWidth/2;
	myPosY = ScreenHeight/2 - normalHeight/2;
	window.moveTo(myPosX,myPosY);	
}

function maxWindow() {
window.moveTo(0,0);
window.outerWidth = screen.availWidth;
window.outerHeight = screen.availHeight;
window.resizeTo(window.outerWidth,window.outerHeight); /*window.resizeTo(screen.width,screen.height)*/
}
/* END resize window */



function centerMe(){
HM_IE = (document.all) ? true : false;
var TheWindowWidth = HM_IE ? document.body.clientWidth : window.innerWidth;
var TheWindowHeight = HM_IE ? document.body.clientHeight : window.innerHeight;
ScreenWidth = screen.width;
ScreenHeight = screen.height;
myPosX = ScreenWidth/2 - TheWindowWidth/2;
myPosY = ScreenHeight/2 - TheWindowHeight/2;
window.moveTo(myPosX,myPosY);
}

function bloque_clic(){return false;}

function MM_findObj(n, d) {
  var p,i,x;  if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_jumpMenu(targ,selObj,restore){
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function MM_preloadImages() {
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() {
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() {
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function confirmDelete() {
	return confirm('Confirmez-vous la suppression ?');
}
