function popup(page,name,w,h,scroll,menubar,resizable,status,toolbar){
	var win=null;
	if (resizable=='no'){resizable='';}else{resizable=',resizable';}
	LeftPosition=(screen.width)?(screen.width-w)/2:0;
	TopPosition=(screen.height)?(screen.height-h)/2:0;
	settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+
		',status='+status+',toolbar='+toolbar+resizable;
	win=window.open(page,name,settings);
}

function popup_fs(page,name,w,h,scroll,menubar,resizable,status,toolbar){
	// version full screen
	var win=null;
	if (resizable=='no'){resizable='';}else{resizable=',resizable';}
	LeftPosition=(screen.width)?(screen.width-w)/2:0;
	TopPosition=(screen.height)?(screen.height-h)/2:0;
	settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+
		',status='+status+',toolbar='+toolbar+resizable;
	win=window.open(page,name,settings);
	win.moveTo(0,0);
	win.resizeTo(screen.width,(screen.height-25));
}


var cpt=0;
function unClic(){
	cpt++;
	if(cpt>1){
		window.status="Merci de ne soumettre ce formulaire qu\'une fois";		
	}else{
		  document.ajouter.submit();
	}
}


function trim (chaine) {
 chaine = unescape(chaine);
 return chaine.replace(/(^\s*)|(\s*$)/g, "");
}