/** * jquery.scrollto - easy element scrolling using jquery. * copyright (c) 2007-2009 ariel flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com * dual licensed under mit and gpl. * date: 5/25/2009 * @author ariel flesler * @version 1.4.2 * */ ;(function(d){var k=d.scrollto=function(a,i,e){d(window).scrollto(a,i,e)};k.defaults={axis:'xy',duration:parsefloat(d.fn.jquery)>=1.3?0:1};k.window=function(a){return d(window)._scrollable()};d.fn._scrollable=function(){return this.map(function(){var a=this,i=!a.nodename||d.inarray(a.nodename.tolowercase(),['iframe','#document','html','body'])!=-1;if(!i)return a;var e=(a.contentwindow||a).document||a.ownerdocument||a;return d.browser.safari||e.compatmode=='backcompat'?e.body:e.documentelement})};d.fn.scrollto=function(n,j,b){if(typeof j=='object'){b=j;j=0}if(typeof b=='function')b={onafter:b};if(n=='max')n=9e9;b=d.extend({},k.defaults,b);j=j||b.speed||b.duration;b.queue=b.queue&&b.axis.length>1;if(b.queue)j/=2;b.offset=p(b.offset);b.over=p(b.over);return this._scrollable().each(function(){var q=this,r=d(q),f=n,s,g={},u=r.is('html,body');switch(typeof f){case'number':case'string':if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(f)){f=p(f);break}f=d(f,this);case'object':if(f.is||f.style)s=(f=d(f)).offset()}d.each(b.axis.split(''),function(a,i){var e=i=='x'?'left':'top',h=e.tolowercase(),c='scroll'+e,l=q[c],m=k.max(q,i);if(s){g[c]=s[h]+(u?0:l-r.offset()[h]);if(b.margin){g[c]-=parseint(f.css('margin'+e))||0;g[c]-=parseint(f.css('border'+e+'width'))||0}g[c]+=b.offset[h]||0;if(b.over[h])g[c]+=f[i=='x'?'width':'height']()*b.over[h]}else{var o=f[h];g[c]=o.slice&&o.slice(-1)=='%'?parsefloat(o)/100*m:o}if(/^\d+$/.test(g[c]))g[c]=g[c]<=0?0:math.min(g[c],m);if(!a&&b.queue){if(l!=g[c])t(b.onafterfirst);delete g[c]}});t(b.onafter);function t(a){r.animate(g,j,b.easing,a&&function(){a.call(this,n,b)})}}).end()};k.max=function(a,i){var e=i=='x'?'width':'height',h='scroll'+e;if(!d(a).is('html,body'))return a[h]-d(a)[e.tolowercase()]();var c='client'+e,l=a.ownerdocument.documentelement,m=a.ownerdocument.body;return math.max(l[h],m[h])-math.min(l[c],m[c])};function p(a){return typeof a=='object'?a:{top:a,left:a}}})(jquery); /* jquery easing */ jquery.easing.jswing=jquery.easing.swing; jquery.extend(jquery.easing,{def:"easeoutquad",swing:function(e,a,c,b,d){return jquery.easing[jquery.easing.def](e,a,c,b,d)},easeinquad:function(e,a,c,b,d){return b*(a/=d)*a+c},easeoutquad:function(e,a,c,b,d){return-b*(a/=d)*(a-2)+c},easeinoutquad:function(e,a,c,b,d){if((a/=d/2)<1)return b/2*a*a+c;return-b/2*(--a*(a-2)-1)+c},easeincubic:function(e,a,c,b,d){return b*(a/=d)*a*a+c},easeoutcubic:function(e,a,c,b,d){return b*((a=a/d-1)*a*a+1)+c},easeinoutcubic:function(e,a,c,b,d){if((a/=d/2)<1)return b/ 2*a*a*a+c;return b/2*((a-=2)*a*a+2)+c},easeinquart:function(e,a,c,b,d){return b*(a/=d)*a*a*a+c},easeoutquart:function(e,a,c,b,d){return-b*((a=a/d-1)*a*a*a-1)+c},easeinoutquart:function(e,a,c,b,d){if((a/=d/2)<1)return b/2*a*a*a*a+c;return-b/2*((a-=2)*a*a*a-2)+c},easeinquint:function(e,a,c,b,d){return b*(a/=d)*a*a*a*a+c},easeoutquint:function(e,a,c,b,d){return b*((a=a/d-1)*a*a*a*a+1)+c},easeinoutquint:function(e,a,c,b,d){if((a/=d/2)<1)return b/2*a*a*a*a*a+c;return b/2*((a-=2)*a*a*a*a+2)+c},easeinsine:function(e, a,c,b,d){return-b*math.cos(a/d*(math.pi/2))+b+c},easeoutsine:function(e,a,c,b,d){return b*math.sin(a/d*(math.pi/2))+c},easeinoutsine:function(e,a,c,b,d){return-b/2*(math.cos(math.pi*a/d)-1)+c},easeinexpo:function(e,a,c,b,d){return a==0?c:b*math.pow(2,10*(a/d-1))+c},easeoutexpo:function(e,a,c,b,d){return a==d?c+b:b*(-math.pow(2,-10*a/d)+1)+c},easeinoutexpo:function(e,a,c,b,d){if(a==0)return c;if(a==d)return c+b;if((a/=d/2)<1)return b/2*math.pow(2,10*(a-1))+c;return b/2*(-math.pow(2,-10*--a)+2)+c}, easeincirc:function(e,a,c,b,d){return-b*(math.sqrt(1-(a/=d)*a)-1)+c},easeoutcirc:function(e,a,c,b,d){return b*math.sqrt(1-(a=a/d-1)*a)+c},easeinoutcirc:function(e,a,c,b,d){if((a/=d/2)<1)return-b/2*(math.sqrt(1-a*a)-1)+c;return b/2*(math.sqrt(1-(a-=2)*a)+1)+c},easeinelastic:function(e,a,c,b,d){e=1.70158;var f=0,g=b;if(a==0)return c;if((a/=d)==1)return c+b;f||(f=d*0.3);if(g div'); tabcontainers.hide().filter(':first').show(); $('div.tabs ul.tabnavigation a').click(function () { tabcontainers.hide(); tabcontainers.filter(this.hash).show(); $('div.tabs ul.tabnavigation a').removeclass('selected'); $(this).addclass('selected'); return false; }).filter(':first').click(); }); /* jquery tabs 2 */ $(function () { var tabcontainers = $('div.tabs2 > div'); tabcontainers.hide().filter(':first').show(); $('ul.tabnavigation2 a').click(function () { tabcontainers.hide(); tabcontainers.filter(this.hash).show(); $('ul.tabnavigation2 a').removeclass('selected'); $(this).addclass('selected'); return false; }).filter(':first').click(); }); /* jquery toggle */ $(document).ready(function () { $(".toggle .description").hide(); $(".toggle .item_wrapper").click(function(){ $(this).next(".description").slidetoggle("fast") .siblings(".description:visible").slideup("fast"); $(this).toggleclass("active"); $(this).siblings(".item_wrapper").removeclass("active"); }); $('#toggle-view li').click(function () { var text = $(this).children('p'); if (text.is(':hidden')) { text.slidedown('200'); $(this).children('span').html('-'); } else { text.slideup('200'); $(this).children('span').html('+'); } }); }); /* jquery overlay gallery */ $(function() { // opacity of button set to 0% $(".overlay_gallery5columns").css("opacity","0"); // on mouse over $(".overlay_gallery5columns").hover(function () { // set opacity to 70% $(this).stop().animate({ opacity: .7 }, "slow"); }, // on mouse out function () { // set opacity back to 50% $(this).stop().animate({ opacity: 0 }, "slow"); }); }); /* jquery overlay portofolio2columns */ $(function() { // opacity of button set to 0% $(".overlay_portfolio2columns").css("opacity","0"); // on mouse over $(".overlay_portfolio2columns").hover(function () { // set opacity to 70% $(this).stop().animate({ opacity: .5 }, "slow"); }, // on mouse out function () { // set opacity back to 50% $(this).stop().animate({ opacity: 0 }, "slow"); }); }); /* jquery overlay portofolio3columns */ $(function() { // opacity of button set to 0% $(".overlay_gallery3columns").css("opacity","0"); // on mouse over $(".overlay_gallery3columns").hover(function () { // set opacity to 70% $(this).stop().animate({ opacity: .5 }, "slow"); }, // on mouse out function () { // set opacity back to 50% $(this).stop().animate({ opacity: 0 }, "slow"); }); }); /* jquery overlay portofolio4columns */ $(function() { // opacity of button set to 0% $(".overlay_gallery4columns").css("opacity","0"); // on mouse over $(".overlay_gallery4columns").hover(function () { // set opacity to 70% $(this).stop().animate({ opacity: .5 }, "slow"); }, // on mouse out function () { // set opacity back to 50% $(this).stop().animate({ opacity: 0 }, "slow"); }); }); /* jquery overlay photostream */ $(function() { // opacity of button set to 0% $(".overlay_photostream").css("opacity","0"); // on mouse over $(".overlay_photostream").hover(function () { // set opacity to 70% $(this).stop().animate({ opacity: .5 }, "slow"); }, // on mouse out function () { // set opacity back to 50% $(this).stop().animate({ opacity: 0 }, "slow"); }); }); /* jquery overlay blog */ $(function() { // opacity of button set to 0% $(".overlay_blog").css("opacity","0"); // on mouse over $(".overlay_blog").hover(function () { // set opacity to 70% $(this).stop().animate({ opacity: .5 }, "slow"); }, // on mouse out function () { // set opacity back to 50% $(this).stop().animate({ opacity: 0 }, "slow"); }); }); /* jquery overlay blog homepage */ $(function() { // opacity of button set to 0% $(".overlay_blog_homepage").css("opacity","0"); // on mouse over $(".overlay_blog_homepage").hover(function () { // set opacity to 70% $(this).stop().animate({ opacity: .5 }, "slow"); }, // on mouse out function () { // set opacity back to 50% $(this).stop().animate({ opacity: 0 }, "slow"); }); }); /* jquery dropdown panel */ $(document).ready(function(){ $(".btn-slide").click(function(){ $("#panel").slidetoggle("slow"); $(this).toggleclass("active"); return false; }); }); /* search form */ $(document).ready(function(){ // add the value of "search..." to the input field $("#search").val("search..."); // when you click on #search $("#search").focus(function(){ // if the value is equal to "search..." if($(this).val() == "search...") { // remove all the text $(this).val(""); } }); // when the focus on #search is lost $("#search").blur(function(){ // if the input field is empty if($(this).val() == "") { // add the text "search..." $(this).val("search..."); } }); $("#search-submit").hover(function(){ $(this).addclass("hover"); }); }); /* contact form */ $(document).ready(function(){ $('#submit-form').click(function(){ var reg = /^([a-za-z0-9_\-\.])+\@([a-za-z0-9_\-\.])+\.([a-za-z]{2,4})$/; var names = $('#contact-form [name="contact-names"]').val(); var email_address = $('#contact-form [name="contact-email"]').val(); var comment = $.trim($('#contact-form .contact-commnent').val()); var data_html ='' ; if(names == ""){ $('.name-required').html('your name is required.'); }else{ $('.name-required').html(''); } if(email_address == ""){ $('.email-required').html('your email is required.'); }else if(reg.test(email_address) == false){ $('.email-required').html('invalid email address.'); }else{ $('.email-required').html(''); } if(comment == ""){ $('.comment-required').html('comment is required.'); }else{ $('.comment-required').html(''); } if(comment != "" && names != "" && reg.test(email_address) != false){ data_html = "names="+ names + "&comment=" + comment + "&email_address="+ email_address; //alert(data_html); $.ajax({ type: 'post', url: 'contact-send.php', data: data_html, success: function(msg){ if (msg == 'sent'){ $('#success').html('message sent!') ; $('#contact-form [name="contact-names"]').val(''); $('#contact-form [name="contact-email"]').val(''); $('#contact-form .contact-commnent').val(''); }else{ $('#success').html('mail error. please try again.!') ; } } }); } return false; }) })