	var page;
   function randomXToY(minVal, maxVal, floatVal)
	{
	  var randVal = minVal+(Math.random()*(maxVal-minVal));
	  return typeof floatVal=='undefined' ? Math.round(randVal) : randVal.toFixed(floatVal);
	}
	function getPageSizeWithScroll(){
		if (window.innerHeight && window.scrollMaxY) {// Firefox
			yWithScroll = window.innerHeight + window.scrollMaxY;
			xWithScroll = window.innerWidth + window.scrollMaxX;
		} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
			yWithScroll = document.body.scrollHeight;
			xWithScroll = document.body.scrollWidth;
		} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
			xWithScroll = document.body.offsetWidth;
			yWithScroll = document.body.offsetHeight;

	  	}
		arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
		//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
		return arrayPageSizeWithScroll;
	}

	function animLadyBug(axisFrom)
	{
	   var width = page[0]-$('#IdLadyBug').width();
// 	   var height = 150-$('#IdLadyBug').height();
	   var height = 150-$('#IdLadyBug').height();
		var axisTo = {'top':(page[1]+parseInt(randomXToY(0, height, 0))), 'left':randomXToY(0, width, 0)};
		top.ladybug = axisTo;

//  		$('#IdLadyBug').animate({'top': axisTo.top+'px','left':axisTo.left+'px'}, (Math.abs(axisFrom.top - axisFrom.left) * 20), 'swing', function(){animLadyBug(axisTo);});
 		$('#IdLadyBug').animate({'top': axisTo.top+'px','left':axisTo.left+'px'}, (Math.abs(axisFrom.top - axisFrom.left) * 20), 'swing');
 		setTimeout('animLadyBug(top.ladybug)', 5000);
   }
   
	function animUfo(axisFrom)
	{
	   var width = page[0]-93;
	   var height = page[1]-49;
		var axisTo = {'top':randomXToY(0, height, 0), 'left':randomXToY(0, width, 0)};
		top.ufo = axisTo;
//  		$('#IdUfo').animate({'top': axisTo.top+'px', 'left':axisTo.left+'px'}, (Math.abs(axisFrom.top - axisFrom.left) * 20), 'swing', function(){animUfo(axisTo);});
		$('#IdUfo').animate({'top': axisTo.top+'px', 'left':axisTo.left+'px'}, (Math.abs(axisFrom.top - axisFrom.left) * 20), 'swing');
		setTimeout('animUfo(top.ufo)', 3000);
   }

	function animHead()
	{
		$('#IdHead').animate({'top': '5px'}, 1000, 'swing');
 		$('#IdHead').animate({'top': '0px'}, 1000, 'swing');
      setTimeout("animHead()", 10000);
   }
	function animBaloon(id, isPossible)
	{
	   if (isPossible)
	   {
			var zero = parseInt($('#'+id).css("top"));
			$('#'+id).animate({'top': zero+10+'px'}, 1000, 'swing');
	 		$('#'+id).animate({'top': $('#'+id).css("top")}, 1000, 'swing');
 		}
      setTimeout('animBaloon(\''+id+'\', true)', 25000*Math.random());
   }
	function anim(axisFrom)
	{
// 		alert('['+page[0]+','+page[1]+']');
		var axisTo = {'top':randomXToY(0, page[1], 0), 'left':randomXToY(0, page[0], 0)};
// 		alert('['+page[0]+','+page[1]+']'+'['+axisTo.top+','+axisTo.left+']	');
//       $('#balonek').animate({'top': axisFrom.top+'px','left': axisFrom.left+'px'}, (Math.abs(axisFrom.top - axisFrom.left) * 30));
//       $('#balonek').animate({'top': axisFrom.top+'px','left': axisFrom.left+'px'}, 1));
 		$('#balonek').animate({'top': axisTo.top+'px','left':axisTo.left+'px'}, (Math.abs(axisFrom.top - axisFrom.left) * 20), 'swing', function(){anim(axisTo);});
   }
   



