function toggleFullText(aId,divId){
	$("#"+divId).slideToggle('slow',function setReadMoreText(){
			if($("#"+divId).css('display') == "none"){
			$("#"+aId).text(getProp(aId+'_closed'));
		}else{
			$("#"+aId).text(getProp(aId+'_open'));
		}		
	});	
}

$(window).bind('load', function() {
	$("#loader").hide();
	setInterval ( "rettificaFooter()", 10 );
});	

function carosella(id){

	 $("#"+id+"").jCarouselLite({
		 visible: 4,
       mouseWheel: true,
    	circular: true,
	   vertical:true,
			 auto:true,
			 speed:1500
    });
}


function openWorkArchive(which){
	if(which == 'year'){
		$("#archive_client, #archive_type, #archive_client_vert_bar, #archive_type_vert_bar, #archive_year_vert_bar").hide();
		$("#archive_year_vert_bar").show();
		$("#archive_year").show();
	}
	if(which == 'type'){
		$("#archive_client, #archive_year, #archive_client_vert_bar, #archive_type_vert_bar, #archive_year_vert_bar").hide();
		$("#archive_type_vert_bar").show();
		$("#archive_type").show();
	}
	if(which == 'client'){
		$("#archive_type, #archive_year, #archive_client_vert_bar, #archive_type_vert_bar, #archive_year_vert_bar").hide();
		$("#archive_client_vert_bar").show();
		$("#archive_client").show();
	}
}
/*
$(document).ready(function(){
	if($("#footer").position().top <= 1065){
		$("#footer").css("margin-top","-63px");
		$("#footer").css("position","relative");
	}else{
		//alert($("#footer").position().top);
	}
});
*/


function rettificaFooter(){
	return;
	if($("#whats_next_down").length > 0){
	  if($("#footer").position().top < ($("#whats_next_down").position().top+$("#whats_next_down").height()+20)){
		$("#footer").css("margin-top","0px");
	  }
	}
	if($("#footer").position().top <= 1065){
		$("#footer").css("margin-top","-63px");
		$("#footer").css("position","relative");
	}
}