$(document).ready(function(){
	$(".tab_menu").click(function(){
	
		$(".txt_data").hide();
		var div_to_display = this.id.substr(4,this.id.length);
		$("#" + div_to_display).show();
		
		$(".tab_menu").removeClass('tab_hover');
		$(this).addClass('tab_hover');
		
	});
	
	//text scroll
	var bigBoxHeight = $("div#boxcont_caratteristiche").innerHeight();
	var boxHeight = $("div#box_caratteristiche").innerHeight();
	var actualBoxY = 0;
	var maxScrollUp = bigBoxHeight - boxHeight;
	
	if(maxScrollUp > 0)
		$("#scroll_down").hide();

	$("#down_c").click(function(){
		actualBoxY = parseInt(actualBoxY - 35);
		if(actualBoxY > maxScrollUp-30){
			$("#box_caratteristiche").animate({
			
				top: actualBoxY
			
			});
			$("#scroll_up").show();
		}else{
			$("#scroll_down").hide();
		}
		
	});
	
	$("#up_c").click(function(){
		
		
		var topdiv = $("#box_caratteristiche").css("top");
		topdiv = parseInt(topdiv.substr(0,topdiv.indexOf("px")));

		if(topdiv < 0){
			
			actualBoxY = parseInt(actualBoxY + 35);
			
			$("#box_caratteristiche").animate({
				top: topdiv != actualBoxY?actualBoxY:actualBoxY + 35
			});
			$("#scroll_down").show();
			
		}else{
			$("#scroll_up").hide();
		}
	});
	
	
});

jQuery(document).ready(function() {
	
	var options =
	{	
		zoomWidth: 371,
		zoomHeight: 377,
		zoomType:'reverse',
		xOffset: 3,
		yOffset:0
	}
	$(".foo").click(function(){
		$(this).remove();
	});
	$(".jqzoom").jqzoom(options);
	
});
