/*
 *  Haras-nationaux.fr
 */

function dispMenu(fromItem, toItem) {
  $('.menu_popup').hide();
  /* $(fromItem).TransferTo({to: toItem, className: 'transferer1', duration: 400}); */
  $('#'+toItem).show("slow");
  
}


$(document).ready(function() {	
	$(".fce-gris-fb .plus").click(function() {
			$(this).parent().next().show("blind");
	});
	$(".fce-gris-fb .moins").click(function() {
		$(this).parent().next().hide("blind");
	});
	
	/*
	 * Boutons des démarches
	 */
	$(".fce-demarche .description-ouverte").prev().find('.infos').html('Masquer')
	$(".fce-demarche .titre span.infos").click(function() {
		if($(this).parent().next().is(':visible')) {
			$(this).html('Plus d\'infos');
			$(this).css('background-image', 'url(fileadmin/templates/internet/images/page_poles/puce_plus.gif)');
			$(this).parent().next().hide("blind");
		} else {
			$(this).html('Masquer');
			$(this).css('background-image', 'url(fileadmin/templates/internet/images/page_poles/puce_moins.gif)');
			$(this).parent().next().show("blind");
		}
	});
	
	
	/**
	 * Zone de recherche dans le bandeau
	 */
	$('#searchBox select').change(function() {
		$("#searchBox").attr("action", "index.php?id=" + $(this).val());
	});
	
	/**
	 * Bloc de connexion
	 */
	if($("#loginForm").length) {
		$('#loginForm #username').bind('keyup focuson click', function () {
			if($(this).val() == 'identifiant') {
				$(this).val('');
			}
		});
		$('#loginForm #password').bind('keyup focuson click', function () {
			if($(this).val() == 'password') {
				$(this).val('');
			}
		
		});
	}
	
	/**
	 * Tooltip
	 */
	$('.tooltipDfn').each(function() {
		$(this).qtip({
			content: $(this).attr('tooltip')
		});
		$(this).click(function(){ return false; })
	});
});
