// JavaScript Document
function entrySpot(obj){
	var top = Math.floor(Math.random()*550) + 50;
	var left = Math.floor(Math.random()*950) + 50;
	$(obj).css("top", top + 'px').css("left", left + 'px');
}

function shyInit(){
	entrySpot('#lilShy');
	entrySpot('#lilShy2');
	entrySpot('#lilShy3');
	entrySpot('#lilShy4');
	entrySpot('#lilShy5');
	$("#lilShy").everyTime(940, "shymove", function() { 
			var currTop = $(this).css("top");
			var tTop = parseInt(currTop);
			var curLeft = $(this).css("left");
			var tLeft = parseInt(curLeft);
			var vert = Math.floor(Math.random()*200) - 100;			
			var newTop = tTop + (vert);
			var horz = Math.floor(Math.random()* 200) - 100;
			var newLeft = tLeft + (horz);
			$(this).animate( { top:newTop }, { queue:false, duration:800 } )
         .animate( { left:newLeft }, { queue:false, duration:800 } );});						
	$("#lilShy2").everyTime(960, "shymove2", function() { 
			var currTop = $(this).css("top");
			var tTop = parseInt(currTop);
			var curLeft = $(this).css("left");
			var tLeft = parseInt(curLeft);
			var vert = Math.floor(Math.random()*200) - 100;			
			var newTop = tTop + (vert);
			var horz = Math.floor(Math.random()* 200) - 100;
			var newLeft = tLeft + (horz);
			$(this).animate( { top:newTop }, { queue:false, duration:800 } )
         .animate( { left:newLeft }, { queue:false, duration:800 } );});						
	$("#lilShy3").everyTime(980, "shymove3", function() {  
			var currTop = $(this).css("top");
			var tTop = parseInt(currTop);
			var curLeft = $(this).css("left");
			var tLeft = parseInt(curLeft);
			var vert = Math.floor(Math.random()*200) - 100;			
			var newTop = tTop + (vert);
			var horz = Math.floor(Math.random()* 200) - 100;
			var newLeft = tLeft + (horz);
			$(this).animate( { top:newTop }, { queue:false, duration:800 } )
         .animate( { left:newLeft }, { queue:false, duration:800 } );});
	$("#lilShy4").everyTime(1000, "shymove4", function() { 
			var currTop = $(this).css("top");
			var tTop = parseInt(currTop);
			var curLeft = $(this).css("left");
			var tLeft = parseInt(curLeft);
			var vert = Math.floor(Math.random()*200) - 100;			
			var newTop = tTop + (vert);
			var horz = Math.floor(Math.random()* 200) - 100;
			var newLeft = tLeft + (horz);
			$(this).animate( { top:newTop }, { queue:false, duration:800 } )
         .animate( { left:newLeft }, { queue:false, duration:800 } );});
	$("#lilShy5").everyTime(1010, "shymove5", function() { 
			var currTop = $(this).css("top");
			var tTop = parseInt(currTop);
			var curLeft = $(this).css("left");
			var tLeft = parseInt(curLeft);
			var vert = Math.floor(Math.random()*200) - 100;			
			var newTop = tTop + (vert);
			var horz = Math.floor(Math.random()* 200) - 100;
			var newLeft = tLeft + (horz);
			$(this).animate( { top:newTop }, { queue:false, duration:800 } )
         .animate( { left:newLeft }, { queue:false, duration:800 } );});
	$(".lilPix").draggable({start: function() {$(this).stop().stopTime();}});
	$(".lilPix").bind('dragstop', function() {$(this).everyTime(940, "shymoveAgain", function() { var currTop = $(this).css("top");var tTop = parseInt(currTop);var curLeft = $(this).css("left");var tLeft = parseInt(curLeft);var vert = Math.floor(Math.random()*200) - 100;	var newTop = tTop + (vert);var horz = Math.floor(Math.random()* 200) - 100;var newLeft = tLeft + (horz);$(this).animate( { top:newTop }, { queue:false, duration:800 } ).animate( { left:newLeft }, { queue:false, duration:800 } );});});
	$(".highP").mouseover(function() {$(this).animate( {color:"#1d1d1d"} , { queue:false, duration:20 });});
	$(".highP").mouseout( function() {$(this).animate( {color:"#000000"} , { queue:false, duration:800 });});
}


