function ouvrir_news(id_news,lang) {
	ch = "detail_news.asp?id_news=" + id_news + "&lang=" + lang ;
	var lg=500;
	var ht=400;
	var left=(screen.width-lg)/2;
	var top=(screen.height-ht)/2; 
	window.open(ch,"","top="+top+",left="+left+",width="+lg+",height="+ht+",menubar=no,scrollbars=yes,statusbar=no"); 
}
/////////////////

function verif_rech() {
	d = document.forms[0] ;
	_go = true ;
	if (d.id_type_emploi.selectedIndex==0) {
		_go = false ;
		alert(err_type_emploi) ;
	}
	if (_go==true) {
		d.ACT.value="liste";
		d.submit();
	}
}

function retab() {
	d = document.forms[0] ;
	d.id_type_emploi.selectedIndex=0 ;
	d.id_contrat.selectedIndex=0 ;	
	d.id_local.selectedIndex=0 ;	
	d.id_modele.selectedIndex=0 ;	
	}

/////////////////////////
function show_autres_form() {
	if (document.forms[0].id_formation[document.forms[0].id_formation.selectedIndex].value==11) {
		obj = document.getElementById("autres_form_lib") ;
		obj.innerHTML = "Autres, précisez : " ;
		
		obj = document.getElementById("autres_form_val") ;
		obj.innerHTML =  "x" ;
		input = document.createElement("input");
		input.style.width = "200px";
		input.style.rows = 1;
		input.maxlength = 5 ;
		input.id="autres_form" ;
		obj.replaceChild(input, obj.firstChild);
	}
	else {
		obj = document.getElementById("autres_form_lib") ;
		obj.innerHTML = "" ;
		obj = document.getElementById("autres_form_val") ;
		obj.innerHTML =  "" ;
	}
}

/////////////////////////
function show_autres_form2() {
	if (document.forms[0].id_source[document.forms[0].id_source.selectedIndex].value==8) {
		obj = document.getElementById("autres_form_lib2") ;
		obj.innerHTML = "Autres, précisez : " ;
		
		obj = document.getElementById("autres_form_val2") ;
		obj.innerHTML =  "x" ;
		input = document.createElement("input");
		input.style.width = "200px";
		input.style.rows = 1;
		input.maxlength = 5 ;
		input.id="autres_sources" ;
		obj.replaceChild(input, obj.firstChild);
	}
		else {
		obj = document.getElementById("autres_form_lib2") ;
		obj.innerHTML = "" ;
		obj = document.getElementById("autres_form_val2") ;
		obj.innerHTML =  "" ;
	}
}

////////////////////////////
function verif_form_cand(questions, id_pays) {
	_go = true ;
	d = document.forms[0];

	if (d.nom.value=="") {
		_go = false ;
		}
	if (d.prenom.value=="") {
		_go = false ;
		}
	if (d.mail.value=="") {
		_go = false ;
		}
	if ( (d.jj.value=="") || (d.mm.value=="") || (d.aa.value=="") ) {
		_go = false ;
		}
		
	if (d.id_formation.selectedIndex==0) {
		_go = false ;
		}

	if  (d.id_formation[d.id_formation.selectedIndex].value==11 || d.id_formation[d.id_formation.selectedIndex].value==14 || d.id_formation[d.id_formation.selectedIndex].value==13) {
		if (d.autres_form.value=="")  {
			_go = false ;
			}
	}

	if  (d.id_source[d.id_source.selectedIndex].value==8) {
		if (d.autres_sources.value=="")  {
			_go = false ;
			}
	}
		
	if (_go==false) alert(err_oblig);
	else { 
			////////////////////////////////////////////////////
			if (d.nom_cv.value=="") {
				_go = false;
				alert(err_cv1);
			}
			if (d.nom_cv.value!="") {
			txt = d.nom_cv.value;
			ext = txt.split(".");
			l = ext.length ;
			if ( (ext[l-1]!="doc")&& (ext[1-1]!="rtf")&& (ext[l-1]!="pdf") ) {
				_go = false;
				alert(err_cv2);
				}
			}
if (id_pays != 3 ) { 
			////////////////////////////////////////////////////
			if (d.nom_lettre.value=="") {
				_go = false;
				alert(err_lettre1);
			}
			if (d.nom_lettre.value!="") {
			txt = d.nom_lettre.value;
			ext = txt.split(".");
			l = ext.length ;
			if ( (ext[l-1]!="doc")&& (ext[1-1]!="rtf")&& (ext[l-1]!="pdf") ) {
				_go = false;
				alert(err_lettre2);
				}
			}
		}
	}

	if (_go==true) {
		d.action = "enreg_cand.asp" ;
		d.submit();
	}
	
}


////////////////////////////
function verif_form_cand_spon(id_pays) {
	_go = true ;
	d = document.forms[0];

		if (d.id_type_emploi.selectedIndex==0) {
			_go = false ;
			}
		else {
			if (d.id_local.selectedIndex==0) {
				_go = false ;
				}
			if (d.id_modele.selectedIndex==0) {
				_go = false ;
				}
		}
		if (d.id_contrat.selectedIndex==0) {
			_go = false ;
			}


	if (d.nom.value=="") {
		_go = false ;
		}
	if (d.prenom.value=="") {
		_go = false ;
		}
	if (d.mail.value=="") {
		_go = false ;
		}
	if ( (d.jj.value=="") || (d.mm.value=="") || (d.aa.value=="") ) {
		_go = false ;
		}

	if (d.nom_cv.value=="") {
		_go = false;
	}

	if (d.id_formation.selectedIndex==0) {
		_go = false ;
		}

	if  (d.id_formation[d.id_formation.selectedIndex].value==11 || d.id_formation[d.id_formation.selectedIndex].value==14 || d.id_formation[d.id_formation.selectedIndex].value==13) {
		if (d.autres_form.value=="")  {
			_go = false ;
			}
	}
	if  (d.id_source[d.id_source.selectedIndex].value==8) {
		if (d.autres_sources.value=="")  {
			_go = false ;
			}
	}
	
if (id_pays != 3 ) { 
	if (d.nom_lettre.value=="") {
		_go = false;
	}
}

	if (_go ==false) alert(err_oblig) ;


		
	if (d.nom_cv.value!="") {
	txt = d.nom_cv.value;
	ext = txt.split(".");
	l = ext.length ;
	if ( (ext[l-1]!="doc")&& (ext[1-1]!="rtf")&& (ext[l-1]!="pdf") ) {
		_go = false;
		alert(err_cv2);
		}
	}

if (id_pays != 3 ) { 
	if (d.nom_lettre.value!="") {
	txt = d.nom_lettre.value;
	ext = txt.split(".");
	l = ext.length ;
	if ( (ext[l-1]!="doc")&& (ext[1-1]!="rtf")&& (ext[l-1]!="pdf") ) {
		_go = false;
		alert(err_lettre2);
		}
	}
}
	if (_go==true) {
		d.action = "enreg_cand.asp" ;
		d.submit();
	}
	
}


function recharge() {
	d = document.forms[0];
	ch ="cand_spon.asp?rub1=14&rub2=16" ;
	ch +="&id_type_emploi=" + d.id_type_emploi[d.id_type_emploi.selectedIndex].value ;
	document.location = ch ;
	
}

function recharge2() {
	d = document.forms[0];
	ch ="cand_spon.asp?rub1=14&rub2=16" ;
	ch +="&id_type_emploi=" + d.id_type_emploi[d.id_type_emploi.selectedIndex].value ;
	ch +="&id_local=" + d.id_local[d.id_local.selectedIndex].value ;
	ch +="&id_modele=" + d.id_modele[d.id_modele.selectedIndex].value ;
	ch +="&id_contrat=" + d.id_contrat[d.id_contrat.selectedIndex].value ;
	document.location = ch ;
	
}

//////////////////
function ouvrir_alertes(id_type_emploi,id_contrat, id_local, id_metier,lang) {
	ch = "inscrip_alertes.asp?id_type_emploi=" + id_type_emploi + "&id_contrat=" + id_contrat  + "&id_metier=" + id_metier + "&id_local=" + id_local+ "&lang=" + lang ;
	var lg=500;
	var ht=400;
	var left=(screen.width-lg)/2;
	var top=(screen.height-ht)/2; 
	window.open(ch,"","top="+top+",left="+left+",width="+lg+",height="+ht+",menubar=no,scrollbars=yes,statusbar=no"); 
}

function verif_alertes() {
	_go = true ;
	d = document.forms[0];

	if (d.mail.value=="") {
		_go = false ;
		alert("Veuillez saisir votre e-mail") ;
		}
		else {
		txt = d.mail.value ;
		if (txt.indexOf('@')==-1) {
			_go = false;
			alert("Votre adresse e-mail est mal formée");
		}
		}
	if (_go==true) {
		d.ACT.value = "ok" ;
		d.submit();
	}
}

function verif_desabonn() {
	_go = true ;
	d = document.forms[0];

	if (d.mail.value=="") {
		_go = false ;
		alert("Veuillez saisir votre e-mail") ;
		}
		else {
		txt = d.mail.value ;
		if (txt.indexOf('@')==-1) {
			_go = false;
			alert("Votre adresse e-mail est mal formée");
		}
		}
	if (_go==true) {
		d.ACT.value = "ok" ;
		d.submit();
	}
}


function verif_questions() {
	d = document.forms[0];
	d.ACT.value = "verif_questions" ;
	d.submit();
	}

