/**
* Ravand Parsian - Home Page JS
* Author: Sam Miremad
* URL: http://www.ravandweb.com/
* Version: 1.1
*
**/
;(function($){var defaults={images:['images/s1.png','images/s2.png','images/s3.png','images/s4.png','images/s5.png','images/s6.png'],total:100};$.firefly=function(settings){$.firefly.settings=$.extend({},defaults,settings);if($.firefly.preloadImages()){for(i=0;i<$.firefly.settings.total;i++){$.firefly.fly($.firefly.create($.firefly.settings.images[$.firefly.random(($.firefly.settings.images).length)]));}}
return;};$.firefly.create=function(img){spark=$('<img>').attr({'src':img}).hide();$(document.body).append(spark);return spark.css({'position':'absolute','z-index':$.firefly.random(20),top:$.firefly.random(400),left:$.firefly.random(($(window).width()-150))}).show();}
$.firefly.fly=function(sp){$(sp).animate({top:$.firefly.random(400),left:$.firefly.random(($(window).width()-150))},(($.firefly.random(10)+5)*2100),function(){$.firefly.fly(sp)});};$.firefly.preloadImages=function(){var preloads=new Object();for(i=0;i<($.firefly.settings.images).length;i++){preloads[i]=new Image();preloads[i].src=$.firefly.settings.images[i];}
return true;}
$.firefly.random=function(max){return Math.ceil(Math.random()*max)-1;}})(jQuery);$(document).ready(function(){$(window).load(function(){$.firefly();});var $nav=$('#hn');var resetPos=$nav.find('li.current').position();if(resetPos){resetPos=resetPos.left+(($nav.find('li.current').width()/2)-73)}else{resetPos=0}
var pos=0;var $h=$nav.find('#home-highlight').css({left:resetPos});$nav.find('li').hover(function(){pos=$(this).position();pos=pos.left+(($(this).width()/2)-73);$h.stop().animate({left:pos},200,"easeOutBack");$(this).siblings().stop().fadeTo(300,0.4);},function(){$h.stop().animate({left:resetPos},450,"easeOutBack");$(this).siblings().stop().fadeTo(60,1);})});jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;}});
