// Fichier Javascript pour le thème Dotclear Gigacircus
// ----


var mnuRechercheCache = true;
	$(document).ready(function() {
	//Gestion du sous menu
	//Sous IE, le menu n'apprait pas en fondu à cause de la mauvaise gestion
	//des PNG transparent en fondu (sans parler d'IE 6 :( ...)
	$("#menu li.ssmenu").hover(
		function(){ 
			if ($.browser.msie){
				$(this).children("ul").css("display", "block");
			}
			else{
				$(this).children("ul").fadeIn('slow');
			}
		}, 
		function(){ 
			if ($.browser.msie){
			$(this).children("ul").css("display", "none");
		}
		else {
			$(this).children("ul").fadeOut('fast');
		}
	}
	);
			
	//Gestion du Roll Hover sur le menu Rechercher
	//
	$("#menu li.recherche a").hover(
		function(){
			if(mnuRechercheCache){
				$(this).css("background", "#fff url(http://www.gigacircus.net/blog/themes/gigathem/imgs/menuo.png)");
				$(this).css("color", "#000");
			}
		},
		function(){
			if(mnuRechercheCache){
				$(this).css("background", "none");
				$(this).css("color", "#fff");
			}
			else{
				$(this).css("background", "#fff url(http://www.gigacircus.net/blog/themes/gigathem/imgs/menuo.png)");
				$(this).css("color", "#000");
			}
		}
	);

	//Gestion spécifique au menu Rechercher
	$("#menu li.recherche a" ).click(
		function(){
			if (mnuRechercheCache) {
				if ($.browser.msie){
					$this.parent().children("ul").css("display", "block");
				}
				else {						
					$(this).parent().children("ul").fadeIn('slow');
				}
				mnuRechercheCache = false;
			}
			else {
				if ($.browser.msie){
					$(this).parent().children("ul").css("display", "none");
				}
				else {
					$(this).parent().children("ul").fadeOut('slow');
				}
				mnuRechercheCache = true;
			}	
		}
	);			
});

