function fitToText()
	{
		if (this.scrollHeight>this.clientHeight)
			{
				this.style.height=(this.scrollHeight+20)+"px";
			}
		else
			{
				this.style.height="10px";
				this.style.height=(this.scrollHeight+20)+"px";
			}
	}
		
			
//CONTROLLER BUTTONS
$(document).ready(function(){
		
		$("a.Summary.All").click(function () {
		    $("article#BlogSummary").show();
		    $("article#article3").hide();
		    $("a.Scroll").show();
		    $("a.All").hide();
		});

		$("a.Summary.Scroll").click(function () {
			$("article#BlogSummary").hide();
			  $("article#article3").show();
			  $("a.Scroll").hide();
			  $("a.All").show();
		});
		
		$("div.SecondNav li").hover(function(){
			$(this).animate({
				borderWidth: 20	  //CHANGE BORDER
			}, 200);
		},function(){
			$(this).animate({
				borderWidth: 0   //CHANGE BORDER
			}, 200);
			});
			
		$("div.Thrd.AR").hover(function(){
			$(this).fadeTo("fast", 1.0); // This should set the opacity to 100% on hover
		},function(){
				$(this).fadeTo("fast", 0.5); // This should set the opacity back to 60% on mouseout
		});
		
}); 




$(document).ready(function(){
	$('.Clients.SlideDown').hover(function(){
		$(".Cover", this).stop().animate({top:'136px'},{queue:false,duration:200});
	}, function() {
		$(".Cover", this).stop().animate({top:'190px'},{queue:false,duration:200});
	});
	
	
	
	$('a.Scroll, div.GoUP').click(function(e){
	
			// If a link has been clicked, scroll the page to the link's hash target:
	
			$.scrollTo( this.hash || 0, 700);
			e.preventDefault();
		});
});

// execute your scripts when the DOM is ready. this is mostly a good habit
$(function() {

	// initialize scrollable
	$(".scrollable").scrollable();
});

	//Load URL
	var isPlaying;   
	function openURL(urlString)
	{
	   $("#LoaderContainer").fadeIn("slow");
	   $('body').append("<div id='Video'><div class='CloseVideo'>Bezárás</div><div>");
	   $('#Video').prepend("<iframe src='http://"+urlString+"' id='VideoFrame'/>");
	   
	   $('#Video').fadeIn(300);
	   
	   $("div.CloseVideo").hover(function(){
	   	 $(this).animate({ 
	   	     right: "5px"
	   	   }, 500 );
	   },function(){
	   	$(this).animate({ 
	   	    right: "-105px"
	   	  }, 500 );
	   });

	   
	   
	   $("div.CloseVideo").click(function(){
	   		$('#Video, #VideoFrame').fadeOut('slow',function ()
	   		      {
	   		        $('#VideoFrame').remove();
	   		      });
	   		
	   		if (isPlaying == true) {
	   		  playAudio();
	   		};      
	   		$("#LoaderContainer").fadeOut("slow");
	   });
	   
	   pauseAudio();
	 }
