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);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+ b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+ b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+ b;return-c/2*((--t)*(t-2)- 1)+ b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+ b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+ 1)+ b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+ b;return c/2*((t-=2)*t*t+ 2)+ b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+ b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t- 1)+ b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+ b;return-c/2*((t-=2)*t*t*t- 2)+ b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+ b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+ 1)+ b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+ b;return c/2*((t-=2)*t*t*t*t+ 2)+ b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+ c+ b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+ b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)- 1)+ b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d- 1))+ b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+ 1)+ 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;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)- 1)+ b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+ b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1- t*t)- 1)+ b;return c/2*(Math.sqrt(1-(t-=2)*t)+ 1)+ b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+ b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+ c+ b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+ b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+ c+ b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t- s)+ 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;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t- s))+ b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+ s)+ 2)+ b;},easeInBounce:function(x,t,b,c,d){return c- jQuery.easing.easeOutBounce(x,d-t,0,c,d)+ b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+ b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+ b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+ b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+ b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+ b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+ c*.5+ b;}});jQuery.fn.extend({everyTime:function(interval,label,fn,times){return this.each(function(){jQuery.timer.add(this,interval,label,fn,times);});},oneTime:function(interval,label,fn){return this.each(function(){jQuery.timer.add(this,interval,label,fn,1);});},stopTime:function(label,fn){return this.each(function(){jQuery.timer.remove(this,label,fn);});}});jQuery.extend({timer:{global:[],guid:1,dataKey:"jQuery.timer",regex:/^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/,powers:{'ms':1,'cs':10,'ds':100,'s':1000,'das':10000,'hs':100000,'ks':1000000},timeParse:function(value){if(value==undefined||value==null)
return null;var result=this.regex.exec(jQuery.trim(value.toString()));if(result[2]){var num=parseFloat(result[1]);var mult=this.powers[result[2]]||1;return num*mult;}else{return value;}},add:function(element,interval,label,fn,times){var counter=0;if(jQuery.isFunction(label)){if(!times)
times=fn;fn=label;label=interval;}
interval=jQuery.timer.timeParse(interval);if(typeof interval!='number'||isNaN(interval)||interval<0)
return;if(typeof times!='number'||isNaN(times)||times<0)
times=0;times=times||0;var timers=jQuery.data(element,this.dataKey)||jQuery.data(element,this.dataKey,{});if(!timers[label])
timers[label]={};fn.timerID=fn.timerID||this.guid++;var handler=function(){if((++counter>times&&times!==0)||fn.call(element,counter)===false)
jQuery.timer.remove(element,label,fn);};handler.timerID=fn.timerID;if(!timers[label][fn.timerID])
timers[label][fn.timerID]=window.setInterval(handler,interval);this.global.push(element);},remove:function(element,label,fn){var timers=jQuery.data(element,this.dataKey),ret;if(timers){if(!label){for(label in timers)
this.remove(element,label,fn);}else if(timers[label]){if(fn){if(fn.timerID){window.clearInterval(timers[label][fn.timerID]);delete timers[label][fn.timerID];}}else{for(var fn in timers[label]){window.clearInterval(timers[label][fn]);delete timers[label][fn];}}
for(ret in timers[label])break;if(!ret){ret=null;delete timers[label];}}
for(ret in timers)break;if(!ret)
jQuery.removeData(element,this.dataKey);}}}});jQuery(window).bind("unload",function(){jQuery.each(jQuery.timer.global,function(index,item){jQuery.timer.remove(item);});});$(document).ready(function(){$(".media").click(function(e){e.preventDefault();if($(".media").hasClass("media_open")){$(".media").removeClass("media_open");$("#media_dropdown").hide(150);}
else{$("#media_dropdown").slideDown(500);$(".media").addClass("media_open");}});$("#media_dropdown").mouseup(function(){return false;});$(".media").mouseup(function(){return false;});$(document).mouseup(function(e){if($(e.target).parent(".media").length==0){$(".media").removeClass("media_open");$("#media_dropdown").hide(150);}});});$(document).ready(function(){$(".tab_content").hide();$("ul.tabs li:first").addClass("active").show();$(".tab_content:first").show();$("ul.tabs li").click(function(){$("ul.tabs li").removeClass("active");$(this).addClass("active");$(".tab_content").hide();var activeTab=$(this).find("a").attr("href");$(activeTab).fadeIn();return false;});});$(document).ready(function(){$("a[rel^='prettyPhoto']").prettyPhoto();});$(document).ready(function(){$("ul.portfolio_2 li").hover(function(){$("ul.portfolio_2 li a").not($('a',this)).stop().fadeTo("fast",0.7);},function(){$("ul.portfolio_2 li a").stop().fadeTo("fast",1.0);});$("ul.portfolio_3 li").hover(function(){$("ul.portfolio_3 li a").not($('a',this)).stop().fadeTo("fast",0.7);},function(){$("ul.portfolio_3 li a").stop().fadeTo("fast",1.0);});$("ul.portfolio_4 li").hover(function(){$("ul.portfolio_4 li a").not($('a',this)).stop().fadeTo("fast",0.7);},function(){$("ul.portfolio_4 li a").stop().fadeTo("fast",1.0);});});$(document).ready(function(){$('.latest_posts li img').hover(function(){$(this).stop().animate({"opacity":0.6},500);},function(){$(this).stop().animate({"opacity":1},500);});$('.flickr_badge img').hover(function(){$(this).stop().animate({"opacity":0.6},500);},function(){$(this).stop().animate({"opacity":1},500);});if($.browser.msie){$('.image_effect').css({"visibility":'hidden'});$('a.image_zoom').hover(function(){$('.image_effect',this).stop().css({"visibility":"visible"});},function(){$('.image_effect',this).stop().css({"visibility":"hidden"});});$('a.image_article').hover(function(){$('.image_effect',this).stop().css({"visibility":"visible"});},function(){$('.image_effect',this).stop().css({"visibility":"hidden"});});$('a.image_video').hover(function(){$('.image_effect',this).stop().css({"visibility":"visible"});},function(){$('.image_effect',this).stop().css({"visibility":"hidden"});});$('a.image_audio').hover(function(){$('.image_effect',this).stop().css({"visibility":"visible"});},function(){$('.image_effect',this).stop().css({"visibility":"hidden"});});}
else{$('.image_effect').css({"opacity":0});$('a.image_zoom').hover(function(){$('.image_effect',this).stop().animate({"opacity":1},500);},function(){$('.image_effect',this).stop().animate({"opacity":0},500);});$('a.image_article').hover(function(){$('.image_effect',this).stop().animate({"opacity":1},500);},function(){$('.image_effect',this).stop().animate({"opacity":0},500);});$('a.image_video').hover(function(){$('.image_effect',this).stop().animate({"opacity":1},500);},function(){$('.image_effect',this).stop().animate({"opacity":0},500);});$('a.image_audio').hover(function(){$('.image_effect',this).stop().animate({"opacity":1},500);},function(){$('.image_effect',this).stop().animate({"opacity":0},500);});}
$('.post_widgets ul.share_post li a').css('opacity','0.7');$('.post_widgets ul.share_post li a').hover(function(){$(this).stop().animate({"opacity":1},200);},function(){$(this).stop().animate({"opacity":0.7},200);});});$(document).ready(function(){$('#send_message').click(function(e){e.preventDefault();var error=false;var name=$('#name').val();var email=$('#email').val();var subject=$('#subject').val();var message=$('#message').val();if(name.length==0){error=true;$('#name_error').fadeIn(500);}else{$('#name_error').fadeOut(500);}
if(email.length==0||email.indexOf('@')=='-1'){error=true;$('#email_error').fadeIn(500);}else{$('#email_error').fadeOut(500);}
if(subject.length==0){error=true;$('#subject_error').fadeIn(500);}else{$('#subject_error').fadeOut(500);}
if(message.length==0){error=true;$('#message_error').fadeIn(500);}else{$('#message_error').fadeOut(500);}
if(error==false){$('#send_message').attr({'disabled':'true','value':'Sending...'});var contactformurl=mysiteurl+"/js/send_email.php";$.post(contactformurl,$("#contact_form").serialize(),function(result){if(result=='sent'){$('#cf_submit_p').remove();$('#mail_success').fadeIn(500);}else{$('#mail_fail').fadeIn(500);$('#send_message').removeAttr('disabled').attr('value','Send The Message');}});}});});$(document).ready(function(){var $cn_next=$('#cn_next');var $cn_prev=$('#cn_prev');var $cn_list=$('#cn_list');var $pages=$cn_list.find('.cn_page');var cnt_pages=$pages.length;var page=1;var $items=$cn_list.find('.cn_item');var $cn_preview=$('#cn_preview');var current=1;$items.each(function(i){var $item=$(this);$item.data('idx',i+1);$item.bind('click',function(){var $this=$(this);$cn_list.find('.selected').removeClass('selected');$this.addClass('selected');var idx=$(this).data('idx');var $current=$cn_preview.find('.cn_content:nth-child('+current+')');var $next=$cn_preview.find('.cn_content:nth-child('+idx+')');if(idx>current){$current.stop().animate({'top':'-300px'},600,'easeOutBack',function(){$(this).css({'top':'310px'});}).hide();$next.show().css({'top':'310px'}).stop().animate({'top':'5px'},600,'easeOutBack');}
else if(idx<current){$current.stop().animate({'top':'310px'},600,'easeOutBack',function(){$(this).css({'top':'310px'});}).hide();$next.show().css({'top':'-300px'}).stop().animate({'top':'5px'},600,'easeOutBack');}
current=idx;});});$cn_next.bind('click',function(e){var $this=$(this);$cn_prev.removeClass('disabled');++page;if(page==cnt_pages){$this.addClass('disabled');}
if(page>cnt_pages){page=cnt_pages;return;}
$pages.hide();$cn_list.find('.cn_page:nth-child('+page+')').fadeIn();e.preventDefault();});$cn_prev.bind('click',function(e){var $this=$(this);$cn_next.removeClass('disabled');--page;if(page==1){$this.addClass('disabled');}
if(page<1){page=1;return;}
$pages.hide();$cn_list.find('.cn_page:nth-child('+page+')').fadeIn();e.preventDefault();});});
