function cache_description(e)
{
  if(e==undefined){e=window.event}
  this.value="";
}
function toggleMitre(Bloc,Selection){
  if(Bloc=="top_5"){
    if(Selection=="metiers"){
      jQuery('#onglet_metiers').css('z-index', '6400');
      jQuery('#onglet_formations').css('z-index', '6350');
      jQuery('#onglet_etablissements').css('z-index', '6300');
      jQuery('#liste_resultats').css('border-top', '4px solid #91BCE9');
      jQuery('#top_onglet_formations, #top_onglet_etablissements').hide();
      jQuery('#top_onglet_metiers').show();

    }else{
      if(Selection=="formations"){
        jQuery('#onglet_metiers').css('z-index', '6300');
        jQuery('#onglet_formations').css('z-index', '6400');
        jQuery('#onglet_etablissements').css('z-index', '6350');
        jQuery('#liste_resultats').css('border-top', '4px solid #E85A60');
        jQuery('#top_onglet_metiers, #top_onglet_etablissements').hide();
        jQuery('#top_onglet_formations').show();
      }else{
        if(Selection=="etablissements"){
          jQuery('#onglet_metiers').css('z-index', '6300');
          jQuery('#onglet_formations').css('z-index', '6350');
          jQuery('#onglet_etablissements').css('z-index', '6400');
          jQuery('#liste_resultats').css('border-top', '4px solid #D5628E');
          jQuery('#top_onglet_metiers, #top_onglet_formations').hide();
          jQuery('#top_onglet_etablissements').show();
        }else{

        }
      }
    }
  }else{
    if(Bloc=="blogs"){
      if(Selection=="lyceen"){
        jQuery('#onglet_lyceen').css('z-index', '6350');
        jQuery('#onglet_redaction').css('z-index', '6300');
        jQuery('#liste_commentaires_lyceen').show();
        jQuery('#liste_commentaires_redac').hide();
      }else{
        if(Selection=="redaction"){
          jQuery('#onglet_lyceen').css('z-index', '6300');
          jQuery('#onglet_redaction').css('z-index', '6350');
          jQuery('#liste_commentaires_redac').show();
          jQuery('#liste_commentaires_lyceen').hide();
        }
      }
    }
  }
}

function placeImg(label){
	switch(label){
		case "main":
			document.getElementById('accroche').src='/images/accueil/accroche-main.gif';
			break;
		case "metiers":
			document.getElementById('accroche').src='/images/accueil/accroche-metiers.gif';
			break;
		case "formations":
			document.getElementById('accroche').src='/images/accueil/accroche-formations.gif';
			break;
		case "orientations":
			document.getElementById('accroche').src='/images/accueil/accroche-orientations.gif';
			break;
		}

	}

var stars_clicked = false;

function _highlight_stars(note, id, do_highlight)
{
  for (var i = 1 ; i <= note ; i++)
  {
    if(do_highlight)
      jQuery('#vote_' + id + '_' + i).addClass('ratehover');
    else
      jQuery('#vote_' + id + '_' + i).removeClass('ratehover');
  }
}

function highlight_stars(id, note, do_highlight, clicked)
{
  if (do_highlight && stars_clicked)
  {
    _highlight_stars(stars_clicked, id, false)
    stars_clicked = false;
  }

  if (stars_clicked)
  {
    return;
  }

  _highlight_stars(note, id, do_highlight)

  if (clicked)
  {
    stars_clicked = clicked;
    jQuery('input#vote, input#vote_'+id).val(clicked);
  }

}

jQuery(window).ready(function()
{
	jQuery('.submit_recherche_proximite').click
	(
		function()
		{
		  if($('#recherche_proximite_departement option[@selected]').val() == ''  )
		  {
		    alert('Veuillez saisir un département');
		    return false;
		  }
		}
	)
})