// JavaScript Document - Effects for Country Layout Elements

	$(document).ready(function() {
		setTimeout(animationA, 300);
	});
	
	function animationA(){
		sun_dante();
		goat_rock();
		elephunk();
		hamstergo();
		//turtle();
	}

	function sun_dante(){
		$("#dante").animate({top:"-=10px"},1500).animate({top:"+=10px"}, 2000)
		setTimeout(sun_dante,2000);
		
		//$("#dante").animate({opacity: "0.1", left: "-=160"}, 7200)
		//.animate({opacity: "0.4", top: "+=60", height: "easeOutBounce", height: "easeOutBounce"}, 6200)
		//.animate({opacity: "0.4", top: "+=60", height: "50", width: "50"}, "slow")
		//.animate({opacity: "1", left: "-610", height: "620", width: "620"}, "slow")
		//.animate({top: "0"}, "slow")
		//.slideUp()
		//.slideDown("slow")
		return false;
	}
	
	function elephunk(){
		$("#elephant").animate({top:"-=10px"},2500).animate({top:"+=10px"}, 3800)
		setTimeout(elephunk, 1000);
		
		//$("#dante").animate({opacity: "0.1", left: "-=160"}, 7200)
		//.animate({opacity: "0.4", top: "+=60", height: "easeOutBounce", height: "easeOutBounce"}, 6200)
		//.animate({opacity: "0.4", top: "+=60", height: "50", width: "50"}, "slow")
		//.animate({opacity: "1", left: "-610", height: "620", width: "620"}, "slow")
		//.animate({top: "0"}, "slow")
		//.slideUp()
		//.slideDown("slow")
		return false;
	}
	
	
	function hamstergo(){
		if ($.fn.frameAnimation) {
			//$("#a").frameAnimation({delay:200, repeat:-1, mouseOut:false});
			$("#hamster").frameAnimation({hoverMode:false, delay:200, repeat:-1});
		}
	}

	
	function goat_rock_out(){
		$("#goat")
		.animate({height: "360", width: "0"}, "fast")
	}	
	
	function goat_wait(){
	  var country = "Fiji";
	  var city = "Suva";
	  alert('The city of ' + city + ' is located in ' + country + '.');
	}	
	
	function goat_rock(){
		//$("#goat").animate({top:"-=10px"},1500).animate({top:"+=10px"}, 2000)
		//setTimeout("goat_rock()",2000);
		
		$("#goat")
		//.animate({opacity: "1", left: "-=124"}, 2200)
		//.animate({opacity: "0", left: "+=124"}, 4200)
		//setTimeout("goat_rock()",9000);
		//.animate({opacity: "0.4", top: "+=60", height: "easeOutBounce", height: "easeOutBounce"}, 6200)
		//.animate({opacity: "0.4", top: "+=60", height: "50", width: "50"}, "slow")
		//goat_wait()
		.animate({height: "360", width: "230"}, 300)
		setTimeout(goat_rock_out, 7000);
		setTimeout(goat_rock, 9000);
		//.animate({top: "0"}, "slow")
		return false;
	}	


//------------------------------------------------------------	
// JavaScript Document - Effects for Sea Layout Elements
//------------------------------------------------------------	

	$(document).ready(function() {
		setTimeout(animationB, 0);
	});
	
	function animationB(){
		sun_fish();
	}
	
	function whoble_fish(){
		$("#fish").animate({top:"-=10px"},1500).animate({top:"+=10px"}, 2000)
		setTimeout(whoble_fish, 3000);
	}
		
	function sun_fish(){
		
		//$("#fish").show(2000);
		$("#fish").animate({opacity: "0"}, 0);
		$("#fish").animate({opacity: "1"}, 9200);
		//setTimeout("sun_fish()",5000);
		whoble_fish();
		return false;
	}
	
//------------------------------------------------------------	
// JavaScript Document - Effects for Home page
//------------------------------------------------------------	
		
//------------------------------------------------------------	
// JavaScript Document - Effects for Space Layout Elements
//------------------------------------------------------------	

	$(document).ready(function() {
		sun_alien();
	});
	
	function animationC(){
		sun_alien();
		sun_star();
	}
		
	function sun_alien(){
		//$("#alien").animate({top:"-=10px"},1500).animate({top:"+=10px"}, 2000)
		$("#alien").animate({opacity: "1"}, 0);
		$("#alien").animate({opacity: "0"}, 3000);
		$("#alien").animate({opacity: "1"}, 9200);
		$("#alien").animate({opacity: ".5"}, 9200);
		$("#alien").animate({opacity: "0"}, 9200);
		$("#alien").animate({opacity: ".5"}, 9200);
		$("#alien").animate({opacity: "1"}, 9200);
		$("#alien").animate({opacity: "0"}, 9200);
		$("#alien").animate({opacity: "1"}, 9200);
		
		//setTimeout("sun_alien()",0);
		
		//$("#alien").animate({opacity: "0.4", top: "+=60", height: "easeOutBounce", height: "easeOutBounce"}, 6200)
		//.animate({opacity: "0.4", top: "+=60", height: "50", width: "50"}, "slow")
		//.animate({opacity: "1", left: "-610", height: "620", width: "620"}, "slow")
		//.animate({top: "0"}, "slow")
		//.slideUp()
		//.slideDown("slow")
		return false;
	}
	
	//function sun_sstar(){
		//$('#sstar').animate({'opacity':1}, 300)
    	//$('#sstar').animate({'backgroundPosition':'0px 0px','top':'15%', 'opacity':0});
		//return false;
	//}
	
		$(function() {
		$('#sstar').animate({'opacity':1}, 300);
		$('#sstar').animate({'backgroundPosition':'0px 0px','top':'15%', 'opacity':0}, 500);  
	});
		
		
		

