// JavaScript Document
//<!--
$(document).ready(function(){
	
	var screen_dim = centerThis($('#mobile_box'));	
	
	centerThis($('#hidden'));	
		
	$('#main_container').css({height:(screen_dim.h-20),width:(screen_dim.w-10),overflow:"hidden"});	
	//$('#bottomright_check').css({top:(screen_dim.h-50),left:(screen_dim.w-50)});
	$('#bottomright_check').css({top:(screen_dim.h-50),left:(screen_dim.w-75)});
	$('#bottomleft_check').css({top:(screen_dim.h-50)});
	$('#topright_check').css({left:(screen_dim.w-75)});
	$('#right_check').css({left:(screen_dim.w-75)});
	$('#bottom_check').css({top:(screen_dim.h-50)});
	
	$('#bottomright_check2').css({top:(screen_dim.h-50),left:(screen_dim.w-75)});
	$('#bottomleft_check2').css({top:(screen_dim.h-50)});
	$('#topright_check2').css({left:(screen_dim.w-75)});
	$('#right_check2').css({left:(screen_dim.w-75)});
	$('#bottom_check2').css({top:(screen_dim.h-50)});

	
	var boxcount=Math.floor(Math.random()*30);	
	
	var boxid=0;
	while(boxid < boxcount){
		var bid = "h_box_" + boxid;
		var btop=Math.floor(Math.random()*(screen_dim.h-100));	
		var bleft=Math.floor(Math.random()*(screen_dim.w-100));	
		$('body').append('<div id="'+bid+'" class="random_box" style="top:'+btop+'px;left:'+bleft+'px;"> &nbsp; </div>');
		boxid++;
	}

	$('#mobile_box').hover(function(){
			$('.clicktoshow').css({'color':'#CCC'});		
		},function(){
			$('.clicktoshow').css({'color':'#FF8000'});									
		});
	
	$('.checker').hide();
	$('.checker2').hide();
	$('.lefter').hide();

	$('.lefter').click(function(){
		centerThis($('#mobile_box'));	
		centerThis($('#hidden'));
		$(this).hide();
	});	

	$('#gratella').hover(function(){$('#up_box').css('color','#000');$('#down_box').css('color','#000');},function(){$('#up_box').css('color','#FF8000');$('#down_box').css('color','#FF8000');});
//	$('.clicktoshow').hide();	
	$('.gen_box').hide();
	$('._ita').hide();
	$('.show_help_eng').toggle(function(){$('#help_eng').show(); $(this).text($(this).text().replace("show","hide")); },function(){$('#help_eng').hide(); $(this).text($(this).text().replace("hide","show"));});
	
	$('.show_help_ita').toggle(function(){$('#help_ita').show(); $(this).text($(this).text().replace("mostrare","nascondere"));},function(){$('#help_ita').hide(); $(this).text($(this).text().replace("nascondere","mostrare")); });
	
	$('._veng').click(function(){$('._ita').show(); $('._eng').hide(); $('#help_eng').hide(); $('.show_help_eng').text($('.show_help_eng').text().replace("hide","show"));});
	$('._vita').click(function(){$('._eng').show(); $('._ita').hide(); $('#help_ita').hide(); $('.show_help_ita').text($('.show_help_ita').text().replace("nascondere","mostrare")); });
	
	
	
	$('#up_box').toggle(function(){$('#upper_box').show();},function(){$('#upper_box').hide();});
	$('#down_box').toggle(function(){$('#bottom_box').show();},function(){$('#bottom_box').hide();});
	$('.header').toggle(function(){
			$(this).next(".cont").show(); 
		},function(){
			$(this).next(".cont").hide(); 
		});
	$('.header_hid').toggle(function(){
			$(this).next(".cont_hid").show(); 
		},function(){
			$(this).next(".cont_hid").hide(); 
		});
	
	$('#photo').click(function(){
			$('#photo_cont').show(); 
			$('#photo').hide(); 
	});
	$('#photo_cont').click(function(){
			$('#photo').show(); 
			$('#photo_cont').hide();
	});
	
	$('.cont').hide();
	$('.cont_hid').hide();
});
//-->

