//var domain = "http://"+window.location.hostname;
$(document).ready(function(){//on attend que la page soit charg�e
    ////////MENU///////////////
    $('#ul_menu').css('width', $('#menu').width()+10);
    $('#menu').width(690);
    $('.elm_menu_link').each(function(i,elm){
	
		 $(elm).mouseenter(function(){
			if($(elm).parent().attr('id')!="elm_menu_selected")$(elm).parent().animate({marginTop:'0px'},100);
			if($(elm).parent().attr('id')!="elm_menu_selected")$(elm).parent().addClass('elm_menu_hover');
			 if($(elm).next('.sub_menu').length>0){
			   $(elm).next('.sub_menu').slideDown();  
				 
			 }
		 });
		 $(elm).parent().mouseleave(function(){
			if($(elm).parent().attr('id')!="elm_menu_selected")$(elm).parent().animate({marginTop:'6px'},100);
			 if($(elm).parent().attr('id')!="elm_menu_selected")$(elm).parent().removeClass('elm_menu_hover');
			 if($(elm).next('.sub_menu').length>0){
			   $(elm).next('.sub_menu').slideUp();  
				 
			 }
		 });
    });
    
    
    /*SLIDER*/
   
   if ($('#slider').length>0) {
	
		var demoSlider_3 = Sliderman.slider({
			container: 'slider',
			width: 120,
			height: 120,
			effects: [{name: 'slider', rows: 2, cols: 4, delay: 100, duration: 400, order: 'random', fade: true, chess: true}],
			display: {autoplay: 3000}
		});
	}

    //REDIMENSIONEMENT SLIDER
    if($('#right_col').height()>$('#left_col').height())$('#sidebar').height($('#right_col').height()-200);
    $('body').resize(function(){

        if($('#right_col').height()>$('#left_col').height())$('#sidebar').height($('#right_col').height()-200);
    });
	
	var keywords = $('#searchChp').attr('value');
	$('#searchChp').focus(function(){
		if($(this).attr('value')==keywords){
			$(this).attr('value',"");
		}
	});
	$('#searchChp').focusout(function(){
		if($(this).attr('value')=="")$(this).attr('value',keywords);
	});
});
$(window).load(function(){//on attend que la page soit charg�e
});
