function submitSearchWord(search_form, encoder_form, msg_err){
	var bresult = true;
	if (document.forms[encoder_form].elements['search_words'].value == '') bresult = false;
	if (document.forms[encoder_form].elements['search_words'].value.length < 3){
		alert(msg_err);
		return;
	}
	
	var searchWords = encodeUrl(document.forms[encoder_form].elements['search_words'].value);
	document.forms[search_form].elements['search_words'].value = searchWords;
	
	document.forms[search_form].submit();
}



function nohetoAjax(p_url){
	
 var html = $.ajax({url: p_url, async: false,cache: false}).responseText;
 return html;
}

function nohetoAjaxCross(p_url){

	//var html = $.ajax({url: p_url', async: false,cache: false}).responseText;
	var html = $.getJSON(p_url).responseText;
	//var html = $.ajax('/',{curl: p_url, async: false,cache: false}).responseText;	
	
 	return html;
}
function nohetoAjaxToContent(p_url,p_content){
 var content = nohetoAjax(p_url);
 
 var resultContent = document.getElementById(p_content);
 
 if (resultContent){
 	resultContent.innerHTML  = content;
 }
 return content;
}

function nohetoAjaxToContentCross(p_url,p_content){

 var content = nohetoAjaxCross(p_url);
 
 var resultContent = document.getElementById(p_content);
 
 if (resultContent){
 	resultContent.innerHTML  = content;
 }
 return content;
}

function getStageAnnimationForm(p_conteneur){
	
	nohetoAjaxToContent("http://www2.letudiant.fr/Jobs-Stages/stages-select.asp",p_conteneur);
 
}

function getJobAnnimationForm(p_conteneur){
	
	nohetoAjaxToContent("http://www2.letudiant.fr/Jobs-Stages/jobs-select.asp",p_conteneur);
 
}

function displayEtbListe(p_sector, p_sectorAll, p_category, p_object, p_parent, p_idetab, p_isstand,p_urlpage,p_siteNiv2,p_chapter,p_choix){

	var v_url = '/etu/front/template/body/animation/ajax/inc_liste_etablissement.jspz?sectorId='+p_sector+'&sectorAll='+p_sectorAll;
	v_url += '&category=' + p_category;
	v_url += '&object=' + p_object;
	v_url += '&parent=' + p_parent;
	v_url += '&etbid=' + p_idetab;
	v_url += '&isstand=' + p_isstand;
	v_url += '&xiti_page=' + p_urlpage;
	v_url += '&xiti_sous_site=' + p_siteNiv2;
	v_url += '&xiti_chapter=' + p_chapter;
	v_url += '&choix=' + p_choix;
	nohetoAjaxToContent (v_url, "liste_etablissement");
	$("#logosList ul a").tooltip({
				track: true,
				delay: 0,
				showURL: false				
			});
}



function displayEtbListeAnimFirst(p_sectorAll,p_secteurOrg,p_category,p_object,p_parent,p_urlpage,p_siteNiv2,p_chapter){

var v_url = '/etu/front/template/body/animation/ajax/inc_liste_etablissement_anim.jspz?sectorAll='+p_sectorAll+'&secteurOrg='+p_secteurOrg;
v_url += '&category=' + p_category;
v_url += '&object=' + p_object;
v_url += '&parent=' + p_parent;
v_url += '&xiti_page=' + p_urlpage;
v_url += '&xiti_sous_site=' + p_siteNiv2;
v_url += '&xiti_chapter=' + p_chapter;

//$.ajax({url: v_url,async: false,success: reloadEffetAnim });

	$.ajax({
		url: v_url,
		async: true,
		success: reloadEffetAnim
	});

}

function displayEtbListeAnim(p_sector,p_sectorAll,p_secteurOrg, p_category, p_object, p_parent,p_urlpage,p_siteNiv2,p_chapter){

var v_url = '/etu/front/template/body/animation/ajax/inc_liste_etablissement_anim.jspz?sectorId='+p_sector+'&sectorAll='+p_sectorAll+'&secteurOrg='+p_secteurOrg;
v_url += '&category=' + p_category;
v_url += '&object=' + p_object;
v_url += '&parent=' + p_parent;
v_url += '&xiti_page=' + p_urlpage;
v_url += '&xiti_sous_site=' + p_siteNiv2;
v_url += '&xiti_chapter=' + p_chapter;

$.ajax({url: v_url,async: true,success: reloadEffetAnim });

}

function displayEntListe(p_activite, p_idEnt,p_choix,p_niv,p_geo,p_fonction, p_idEntSel){

	var v_url = '/etu/front/template/body/animation/ajax/inc_liste_entreprise.jspz?';
	v_url += 'activite='+ p_activite;
	v_url += '&ident='+ p_idEnt;
	v_url += '&choix='+ p_choix;
	v_url += '&idEntSel='+ p_idEntSel;
	
	arr = p_niv.split(",");
	for(i=0;i<arr.length;i++)
	{
		v_url += '&niveau='+ arr[i];
	}
	v_url += '&geo='+ p_geo;
	v_url += '&fonction='+ p_fonction;
	nohetoAjaxToContent (v_url, "liste_logo_entreprise");
	$("#logosList ul a").tooltip({
				track: true,
				delay: 0,
				showURL: false				
			});
}


function reloadEffetAnim (content){
	
	var resultContent = document.getElementById("liste_logo_etablissement");
 
	 if (resultContent){
	 
	 	resultContent.innerHTML  = content;
	 	divPager("sidepager-");
	 }
	
}






sas_tmstp = Math.round(Math.random()*10000000000);
sas_masterflag=1;

function SmartAdServer(sas_pageid,sas_formatid,sas_target) {
  if (sas_masterflag==1) {sas_masterflag=0;sas_master='M';} else {sas_master='S';};
  document.write('<div style="z-index:20"><SCR'+'IPT SRC="http://www.smartadserver.com/call/pubj/' + sas_pageid + '/' + sas_formatid + '/'+sas_master + '/' + sas_tmstp + '/' + escape(sas_target) + '?"></SCR'+'IPT></div>');
}


function SmartAdServerAjaxCall(p_container, p_pageid, p_formatid, p_target, p_separateur) {
	
	var ajax_url = '/etu/front/common/publicity/scripter.jspz';
	
	ajax_url += '?';
	ajax_url += 'container=' + p_container;
	ajax_url += '&';
	ajax_url += 'pageid=' + p_pageid;
	ajax_url += '&';
	ajax_url += 'formatid=' + p_formatid;
	ajax_url += '&';
	ajax_url += 'target=' + p_target;
	
	var html = $.ajax({url: ajax_url, async: true, cache: false}).responseText;
	
	var pub_div = document.getElementById(p_container);
	
	if (pub_div) {
		var queryel = '#' + p_container;
		$(queryel).empty();
		$(queryel).append(p_separateur);
		$(queryel).append(html);
	}
}
function nohetoPubCaller (p_url,p_typepub,p_formatid,p_target,p_debug,p_separateur){
	
	
	var v_url = p_url +"?typepub="+p_typepub+"&formatid="+p_formatid+"&target="+p_target+"&debug="+p_debug;
	
	var content = nohetoAjax(v_url);
	
	var resultContent = document.getElementById("skyscraper");
   
	 if (resultContent){
	 	resultContent.innerHTML  = resultContent.innerHTML + p_separateur +content;
	 }
	
	
}

function nohetoPubCallerContent (content){
	
	
	
	var resultContent = document.getElementById("skyscraper");
 
	 if (resultContent){
	 	resultContent.innerHTML  = resultContent.innerHTML + p_separateur +content;
	 	
	 	eval("runPub()")
	 }
	
	
	
}

  function canContiniousSearchSimpleFrm (){
  
      var v_motcle = document.getElementById("SearchSimple_Query");
      
      if (  v_motcle){

          if( v_motcle.value != '' && v_motcle.value.length >= 3){
             return true;
          }else{
          		alert("Veuillez saisir au moins 3 caracteres");
               return false;
          }
        
      }else{
        return false;
      }
  }
  
  function canContiniousSearchSelectsFrm(){
  
  	var v_diplome = document.getElementById("diplome");
  	var v_region = document.getElementById("region");
  	var v_filiere = document.getElementById("filiere");
  	
  	
  	if (v_diplome && v_region && v_filiere){
  	
  		if(v_diplome.value=='' && v_region.value=='' && v_filiere.value=='' ){
  		
  			alert("Veuillez selectionner au moins un critere de recherche.");
  			return false;
  		
  		}else{
  			return true;
  		}
  		
  		
  	}else{
  		return false;
  	}
  
  
  }
 
 function checkIfOneCheked(obj,otherField, form)
{
	if(!eval("document.forms['"+form+"']."+otherField+".checked")) obj.checked = true;
}
 
  function canContiniousSearchSelectsFrmAlt(){
  
  	var v_diplome = document.getElementById("diplomealt");
  	var v_region = document.getElementById("regionalt");
  	var v_filiere = document.getElementById("filierealt");
  	
  	if (v_diplome && v_region && v_filiere){
  	
  		if(v_diplome.value=='' && v_region.value=='' && v_filiere.value==''){
  		
  			alert("Veuillez selectionner au moins un critere de recherche.");
  			return false;
  		
  		}else{
  			return true;
  		}
  		
  		
  	}else{
  		return false;
  	}
  
  
  } 
 
  function canContiniousSearchSimpleFrmAlt (){
  
      var v_motcle = document.getElementById("SearchSimple_QueryAlt");
      
      if (  v_motcle){

          if( v_motcle.value != '' && v_motcle.value.length >= 3){
             return true;
          }else{
          		alert("Veuillez saisir au moins 3 caracteres");
               return false;
          }
        
      }else{
        return false;
      }
  } 
  
function jumpToSectorByJob() {

	var v_ssecteur = document.getElementById("ssecteur");
	if(v_ssecteur){
		
		if(v_ssecteur.value !='#' && v_ssecteur.value !=''){
			 window.location = v_ssecteur.value;
		}
		
	}
    
}
  
function jumpToSector() {

	var v_ssecteur = document.getElementById("ssecteurall");
	if(v_ssecteur){
		
		if(v_ssecteur.value !='#' && v_ssecteur.value !=''){
			 window.location = v_ssecteur.value;
		}
		
	}

}
  
function submitForm(url, letter) {
  document.searchJobForm.elements['letter'].value = letter;
  document.searchJobForm.action = url;
  
  document.searchJobForm.submit();
}


// RTO 20070402 : Gestion des touches appuy??es dans le formulaire 
function Validate(){
  if(event.keyCode == 13){
    validateJobForm();
  }
}



function validateJobForm() {
  var level = document.forms['searchPersoJobForm'].elements['flevel'];
  var levelValue = level.options[level.selectedIndex].value;
  
  var salary = document.forms['searchPersoJobForm'].elements['fsalary'];
  var salaryValue = salary.options[salary.selectedIndex].value;
  
  var hobby = document.forms['searchPersoJobForm'].elements['fhobby'];
  var hobbyValue = hobby.options[hobby.selectedIndex].value;
  
  if (levelValue == '0' && salaryValue == '0' && hobbyValue == '0') {
    alert("merci de selectionner un critere");
    return;
  }
  
  document.forms['searchPersoJobForm'].submit();
}

 function getMapContent(p_zoneid){
 
 	var v_url = '/etu/front/template/body/editorial/ajax/mapContent.jspz?zoneid='+p_zoneid;
 	//nohetoAjaxToContent(v_url,"mapcontentzone");
  	//alert("contenu zone : "+nohetoAjaxToContent(v_url));
 
   return v_url;
 	
 }
 
 function clearMapContent(){
 
		var v_mapcontent = document.getElementById("mapcontentzone");
		if(v_mapcontent){
			v_mapcontent.innerHTML = "";
		}

 }
 
function showHide(id)
{
    var obj = document.getElementById(id);
    if(obj != null) {
	    if(obj.style.display == "block") {
	       obj.style.display= 'none';
	    }
	    else {
	       obj.style.display='block';
	    }
    }
}

/*
	Transmet un formulaire avec l'url sp??cifi??e
*/
function searchForm(formName,url){
	form = document.forms[formName];
	if(form != null)
	{
		form.action = url;
		form.submit();
	}
}





