function print_anpe()
{
	var a = window.open('','', 'scrollbars=yes,resizable=yes,width=650,height=500,left=50,top=50');
	a.document.open("text/html");
	a.document.write('<html><head><link rel="stylesheet" href="/fo/Fr/dynamique/cvcandidat/used_js/entpsebox.css"></head><body>');
	a.document.write(document.getElementById('po').innerHTML);	
	a.document.write('</body></head>');
	//a.document.close();
	a.print();
}
/////////////////////////////////////////////////////////////////////////
function startLoading(div)
{
	document.getElementById(div).style.display="";
}
/////////////////////////////////////////////////////////////////////////
function killLoading(div)
{
	document.getElementById(div).style.display="none";
}
/////////////////////////////////////////////////////////////////////////
function showServ(chec, affiche, page){
	var chec=chec;
	startLoading(chec);	
	var affiche=affiche;
	var page=page;
	new Ajax.Updater(
	affiche,
	page,
	{
		method:"get",
		//parameters:{db:db, usr:usr, pswd:pswd},
		onSuccess: function(){killLoading(chec)}
	}
	);
}
/////////////////////////////////////////////////////////////////////////
function suiviStg(chec, affiche, page){
	var chec=chec;
	startLoading(chec);	
	var affiche=affiche;
	var page=page;
	new Ajax.Updater(
	affiche,
	page,
	{
		method:"get",
		//parameters:{db:db, usr:usr, pswd:pswd},
		onSuccess: function(){killLoading(chec)}
	}
	);
}
/////////////////////////////////////////////////////////////////////////
function startLoader()
{	
	document.getElementById('ess').style.display='';
}
/////////////////////////////////////////////////////////////////////////
function killLoader()
{	
	document.getElementById('ess').style.display='none';
}
/////////////////////////////////////////////////////////////////////////
function submitRegistration()
{	
	startLoader();
	$('registrationForm').request({			
	onComplete : function (response) {registrationResponse(response)},			
	onFailure : function (errorCode) {registrationError(errorCode)} 
			})
}
/////////////////////////////////////////////////////////////////////////
function suiviOffre()
{	
	startLoader();
	$('suiviob').request({			
	onComplete : function (response) {registrationResponse_so(response)},			
	onFailure : function (errorCode) {registrationError(errorCode)} 
			})
}
/////////////////////////////////////////////////////////////////////////
function registrationError(errorCode)
{	
	killLoader();
	alert(errorCode);
}
/////////////////////////////////////////////////////////////////////////
function registrationResponse_so(xhr)
{	
	killLoader();
	if (xhr.status == 200)		
	{						
		response = xhr.responseText;							
		if(response=="OK")			
		{	
			document.getElementById('text_bon').style.display='';							
		}
		else
		{	
			if(response=="OKD")			
			{
				document.getElementById('del_bon').style.display='';
			}
			else
			{
				document.getElementById('text_error').style.display='';							
			}
		}
	}
}
/////////////////////////////////////////////////////////////////////////
function registrationResponse(xhr)
{	
	killLoader();
	if (xhr.status == 200)		
	{						
		response = xhr.responseText;							
		if(response=="OK")			
		{				
			alert("GOOD!!!");							
		}									
	}
}
/////////////////////////////////////////////////////////////////////////
function choice_suivob()
{
	var choice=document.getElementById('typsuiv').value;
	if (choice!="notselected")
	{
		if (choice=="augmreduc")
		{
			document.getElementById('nbr_rub').style.display='';
			document.getElementById('chmod').style.display='none';
			document.getElementById('motif_ann').style.display='none';
		}
		if (choice=="reconversion")
		{
			document.getElementById('chmod').style.display='';
			document.getElementById('motif_ann').style.display='none';
			document.getElementById('nbr_rub').style.display='none';
		}
		if (choice=="annulation")
		{
			document.getElementById('motif_ann').style.display='';
			document.getElementById('chmod').style.display='none';
			document.getElementById('nbr_rub').style.display='none';
		}
		if ((choice=="suspension") ||(choice=="satisfaite"))
		{
			document.getElementById('motif_ann').style.display='none';
			document.getElementById('chmod').style.display='none';
			document.getElementById('nbr_rub').style.display='none';
		}
	}
}
/////////////////////////////////////////////////////////////////////////////
function add_cvs()
{	
	startLoader();
	$('addcvs').request({			
	onComplete : function (response) {registrationResponse_cvs(response)},			
	onFailure : function (errorCode) {registrationError(errorCode)} 
			})
}
/////////////////////////////////////////////////////////////////////////
function registrationResponse_cvs(xhr)
{	
	killLoader();
	if (xhr.status == 200)		
	{						
		response = xhr.responseText;							
		if(response=="OK")			
		{	
			document.getElementById('cvs_added').style.display='';							
		}	
		else
		{
			alert(response);
			document.getElementById('cvsadd_error').style.display='';	
		}
	}
}
/////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
function edit_photo()
{	
	startLoader_ph();
	$('ed_ph').request({			
	onComplete : function (response) {registrationResponse_ph(response)},			
	onFailure : function (errorCode) {registrationError(errorCode)} 
			})
}
/////////////////////////////////////////////////////////////////////////
function registrationResponse_ph(xhr)
{	
	killLoader_ph();
	if (xhr.status == 200)		
	{						
		response = xhr.responseText;		
		//alert(response);
	}
}
/////////////////////////////////////////////////////////////////////////
function startLoader_ph()
{	
	document.getElementById('edit_conf').style.display='';
}
/////////////////////////////////////////////////////////////////////////
function killLoader_ph()
{	
	document.getElementById('edit_conf').style.display='none';
}
/////////////////////////////////////////////////////////////////////////
