// JavaScript by radicalnetworks, Bangalore, India

function ondeggia(elemento) {
    var dato = $(elemento).css('marginTop').split('p');
    if (dato[0] == 596) {
        newy = 587;
        newx = 0;
    } else {
        newy = 596;
        newx = 10;
    }
    $(elemento).animate({
        marginTop: newy
    }, 2500, 'linear', function () {
        ondeggia(this);
    });
}




function check_h(div,h_min,h_max){
	
if ($(div).length>0){
  var h = $(div).css('height').split('p');	
  if(h[0]<=h_min){
  	 $(div).css('height',h_max);
  }
 }
}


function lattina(){
    var dato = $('#lattina_tonno').css('marginTop').split('p');
 
	if(dato[0] == 0) {
		newy = 0;
		//newx = 0;
	} else {
		newy = 0;
	//	newx = 10;
	}
	$('#lattina_tonno').animate({
		marginTop : newy
	}, 1050, 'linear', function() {
		lattina();
	});

	
	
}






