<script type="text/javascript"> var scroller; window.addEvents({'domready':function(){ if(!window.ie6){ var sun=new Element('img',{'src':'<?php bloginfo('template_url'); ?>/images/back_sun.gif','id':'sun'}).inject(document.body); var cloud=new Element('img',{'src':'<?php bloginfo('template_url'); ?>/images/back_cloudright.gif','id':'cloud'}).inject(document.body); var plane=new Element('img',{'src':'<?php bloginfo('template_url'); ?>/images/back_plane.gif','id':'plane'}).inject(document.body); var cloud2=new Element('img',{'src':'<?php bloginfo('template_url'); ?>/images/back_cloudleft.gif','id':'cloud2'}).inject(document.body); var balloon=new Element('img',{'src':'<?php bloginfo('template_url'); ?>/images/back_baloon.gif','id':'balloon'}).inject(document.body); var sun_style=new Fx.Style($('sun'),'top',{duration:2500,transition:Fx.Transitions.Quad.easeOut}); var cloud_style=new Fx.Style($('cloud'),'top',{duration:2500,transition:Fx.Transitions.Quad.easeOut}); var plane_style=new Fx.Style($('plane'),'top',{duration:3500,transition:Fx.Transitions.Quad.easeOut}); var cloud2_style=new Fx.Style($('cloud2'),'top',{duration:2500,transition:Fx.Transitions.Quad.easeOut}); var balloon_style=new Fx.Style($('balloon'),'top',{duration:3500,transition:Fx.Transitions.Quad.easeOut}); scroller=function(){ var distance=(window.getScrollTop()/(window.getScrollHeight()-window.getHeight())); sun_style.stop().start($('sun').getCoordinates().top,(0-(distance*275))); cloud_style.stop().start($('cloud').getCoordinates().top,(315-(distance*415))); plane_style.stop().start($('plane').getCoordinates().top,(550-(distance*600))); cloud2_style.stop().start($('cloud2').getCoordinates().top,(475-(distance*475))); balloon_style.stop().start($('balloon').getCoordinates().top,(185-(distance*180)));} scroller.periodical(100);} },'resize':function(){ if(!window.ie6){ if($('cloud'))$('cloud').setStyle('right',((window.getWidth()-$('main').getCoordinates().right)-65)+'px');}}}); EventCenter.fire('domready'); </script> |