$(document).ready(function(){
	
	$("a#more").bind({
		click:function(){
			//alert($("#moretext").height());
			
			var h = $("#moretext").height()-27;
			
			$("#fake_elem").css("height",h+"px");
			
			if($("#moretext").css("display")=="none"){
				$("#moretext").slideDown();
				$("#fake_elem").slideDown();
			}else{
				$("#moretext").slideUp();
				$("#fake_elem").slideUp();
			}
			
			return false;
		},
		mouseenter: function(){
			$(this).animate({opacity: '0.9'}, 300, 'linear');
		},
		mouseleave: function(){
			$(this).animate({opacity: '1.0'}, 300, 'linear');
		},
	});
	
	$('#slider').bxSlider({mode: 'fade',captions: true,auto: true,controls: true,prevText:'',nextText:'',speed:'3000',pause:'8000'});
	
	var postH = $("#post").height();
	//alert(postH);
	$("#fake_elem_post").css("height",(postH-48)+"px");
	
	$("a[rel^='prettyPhoto']").prettyPhoto();
	
	//$.prettyPhoto.open('http://www.verter.it/auguri/Auguri-Verter_11.jpg','Auguri da Verter','');
	
});

window.onorientationchange = function(){

    var orientation = window.orientation;

    if (orientation === 0){

        // iPad is in Portrait mode.
       window.location.reload();

    }else if (orientation === 90){

		window.location.reload();
    
    }else if (orientation === -90){
		window.location.reload();
    }

}
