//-------------------------- Scrolling Up Button

$(function(){
  $('#btn_up').click(function() {
    $('html,body').animate({scrollTop: 0}, 'slow');
  });

  $(window).scroll(function(){
     if($(window).scrollTop()<300){
        $('#btn_up').fadeOut();
     }else{
        $('#btn_up').fadeIn();
     }
  });
});

//-------------------------- Toggle animation + Search animation button

$(document).ready(function(){
        lastBlock = $("#FirstLinkMenuJquery");
        maxWidth = 245;
        minWidth = 75; 
        
        
		 $('#toggle-form li h1').click(
   		 function() {
         $(this).next().toggle('fast');
         });
         
         $('#toggle-sort li h1').click(
   		function() {
        	$(this).next().toggle('fast');
        });
        
        $('#toggle-blog li h1').click(
   		function() {
        	$(this).next().toggle('fast');
        });

        
          

        $(".MenuJquery ul li span").click(
          function(){
            $(lastBlock).animate({width: minWidth+"px"}, { queue:false, duration:"slow" }, "easeOutExpo");
        $(this).animate({width: maxWidth+"px"}, { queue:false, duration: "slow",}, "easeOutExpo");
        lastBlock = this;
          }
        );
    });
	

//-------------------------- Open News

function toggleAbout() {

	
	if( $('#aboutHolder').css('display') == "none" ) { //show it
		$('#aboutHolder').fadeIn(0);
		$('#aboutHolder').animate({"right": 0},800, "easeOutExpo" );
		
	}else {
		$('#aboutHolder').animate({"right": -500},500 );
		$('#aboutHolder').delay(500).fadeOut(0);
	}
}




function toggleAbout2() {


if( $('#aboutHolder2').css('display') == "none" ) { //show it
		$('#aboutHolder2').fadeIn(0);
		$('#aboutHolder2').animate({"right": 0},800, "easeOutExpo" );
		
	}else {
		$('#aboutHolder2').animate({"right": -500},500 );
		$('#aboutHolder2').delay(500).fadeOut(0);
	}
}
