$(document).ready( function() 
   { 
    $('.slider_elmt.1').hover( function() {
     sliding(1);
    });
    $('.slider_elmt.2').hover( function() {
     sliding(2);
    });
    $('.slider_elmt.3').hover( function() {
     sliding(3);
    });
    
    timing();
				justifySize();
				
				// NEW MENU
				$( ".menu-navigation > ul > li > ul > li > ul > li" ).each( function(){ $(this).children( "ul" ).hide(); $(this).css( "min-height", $(this).innerHeight() + "px" ); } );
				$( ".menu-navigation > ul > li > ul > li" ).each( function(){ $(this).children( "ul" ).hide(); $(this).css( "min-height", $(this).innerHeight() + "px" ); } );
				$( ".menu-navigation > ul > li" ).each( function(){ $(this).children( "ul" ).hide(); $(this).css( "min-height", $(this).innerHeight() + "px" ); } );
				$( ".menu-navigation > ul ul" ).hide();
				$( "li", ".menu-navigation" )
				 .bind( "mouseover",
					       function( e )
												{
												 $(this)
													 .children("ul")
														.stop()
														.slideDown( function(){ $(this).css( "height", "auto" ); } );
												} )
					.bind( "mouseout",
					       function( e )
												{
												 $(this).children("ul").stop().slideUp( function(){ $(this).css( "height", "auto" ); } );
												} );
				

	});
var count = 1;
function timing()
{
 window.setTimeout( function(){ sliding( ((count++%3)+1) );  timing(); }, 5000 );
};

function developMenuTo( id_menu )
{
 var parent = $( "[id_menu=" + id_menu + "]", ".menu-navigation" );
	
	do
	{
	 parent = $(parent).parent();
		
	 if( parent.is( "ul" ) )
		{
		 parent.show();
		}
	}
	while( !parent.is( ".main" ) );
	
}

function sliding( num )
{
 count = num;
 $('#header').removeClass('slide1');
 $('#header').removeClass('slide2');
 $('#header').removeClass('slide3');
 $('.slider_elmt.selected').removeClass('selected');
 $('#header').addClass('slide'+num);
 
 $('.slider_elmt.'+num).addClass('selected');

};
  
function displayAnswer(element, num)
{
	
	if( $("table.faq tr:eq("+(num)+") td span").is(":hidden"))
	{
		$("table.faq tr td span:visible").animate({
																																											height: "toggle"
																																										},200, function() {
																																											$(this).hide();
																																										});
		$("table.faq tr td p.number a").css("color", "#7D7D7D");
		$("table.faq tr td p.number").css("background", "url(/templates/easy-coach-2/imgs/arrow-black.png) no-repeat 0 50%");
		$("table.faq tr:eq("+(num)+") td span").animate({
																																											height: "toggle"
																																										}, 500,function() {
																																											$(this).show();
																																										});
		$("table.faq tr:eq("+(num)+") td p.number a").css("color", "#e42322");
		$("table.faq tr:eq("+(num)+") td p.number").css("background", "url(/templates/easy-coach-2/imgs/arrow-red-down.png) no-repeat 0 50%");
	}
	else
	{
		$("table.faq tr:eq("+(num)+") td span").animate({
																																											height: "toggle"
																																										}, 200, function() {
																																											$(this).hide();
																																										});
		$("table.faq tr:eq("+(num)+") td p.number a").css("color", "#7D7D7D");
		$("table.faq tr:eq("+(num)+") td p.number").css("background", "url(/templates/easy-coach-2/imgs/arrow-black.png) no-repeat 0 50%");
	}
}

function justifySize()
{
	$("#content").css("min-height", $("#menu_left").outerHeight());
	$("#content #news_content").css("min-height", $("#menu_left").outerHeight()-55);
}
