var cloud_count=9;var cloud_width=256;var top_position_max=75;var duration_multiplier=15000;var screen_width=$(window).width();function generateRandomNumber(f,d){var e=Math.floor(Math.random()*d)+f;return e;}function createClouds(){for(var b=0;b<cloud_count;++b){$("body").append('<img src="/images/css/cloud.png" class="cloud" />');}$(".cloud").each(function(a){$(this).css("left",+generateRandomNumber(0,screen_width-cloud_width)+"px").css("top",+generateRandomNumber(0,top_position_max)+"px").fadeIn("slow");animateCloud(this);});}function animateCloud(e){var d=$(e).css("left").replace("px","");var f;if(d>(screen_width/2)){f=0;}else{f=screen_width-cloud_width;}$(e).animate({left:f+"px"},generateRandomNumber(5,8)*duration_multiplier,"linear",function(){new animateCloud(e);});}function animateMeteor(d,e,f){switch(d){case"up":$("#meteor").animate({bottom:"+="+f},e);break;case"down":$("#meteor").animate({bottom:"-="+f},e);break;}}$(document).ready(function(){createClouds();if($("#contact_form").length>0){$("#contact_form").validate();}if($("#meteor").length>0){$("#meteor").removeClass("elevate");$("#meteor").hover(function(){animateMeteor("up",400,12);},function(){animateMeteor("down",400,12);});$('[href="#meteor"]').click(function(){animateMeteor("up",400,22);return false;});$("#meteor").qtip({style:{name:"cream",tip:true},position:{corner:{target:"topMiddle",tooltip:"bottomMiddle"}}});}$(".social li").removeClass("highlight").find("a").append('<span class="hover" />').each(function(){var b=$("> span.hover",this).css("opacity",0);$(this).hover(function(){b.stop().fadeTo(300,1);},function(){b.stop().fadeTo(400,0);});});});
