document.createElement('section');(function($){var calcRotate3Di={direction:function(now){return(now<0?-1:1);},degrees:function(now){return(Math.floor(Math.abs(now)))%360;},scale:function(degrees){return(1-(degrees%180)/90)*(degrees>=180?-1:1);}};$.fx.step.rotate3Di=function(fx){direction=calcRotate3Di.direction(fx.now);degrees=calcRotate3Di.degrees(fx.now);scale=calcRotate3Di.scale(degrees);if(fx.options&&typeof fx.options['sideChange']!='undefined'){if(fx.options['sideChange']){var prevScale=$(fx.elem).data('rotate3Di.prevScale');if(scale*prevScale<=0){fx.options['sideChange'].call(fx.elem,(scale>0||prevScale<0));$(fx.elem).data('rotate3Di.prevScale',$(fx.elem).data('rotate3Di.prevScale')*-1);}}scale=Math.abs(scale);}$(fx.elem).data('rotate3Di.degrees',direction*degrees);$(fx.elem).css('transform','skew(0deg, '+direction*degrees+'deg)'+' scale('+scale+', 1)');};var proxied=$.fx.prototype.cur;$.fx.prototype.cur=function(){if(this.prop=='rotate3Di'){var style=$(this.elem).css('transform');if(style){var m=style.match(/, (-?[0-9]+)deg\)/);if(m&&m[1]){return parseInt(m[1]);}else{return 0;}}}return proxied.apply(this,arguments);};$.fn.rotate3Di=function(degrees,duration,options){if(typeof duration=='undefined'){duration=0;}if(typeof options=='object'){$.extend(options,{duration:duration});}else{options={duration:duration};}if(degrees=='toggle'){if($(this).data('rotate3Di.flipped')){degrees='unflip';}else{degrees='flip';}}if(degrees=='flip'){$(this).data('rotate3Di.flipped',true);var direction=-1;if(typeof options=='object'&&options['direction']&&options['direction']=='clockwise'){direction=1;}degrees=direction*180;}else{if(degrees=='unflip'){$(this).data('rotate3Di.flipped',false);degrees=0;}}var d=$(this).data('rotate3Di.degrees')||0;$(this).data('rotate3Di.prevScale',calcRotate3Di.scale(calcRotate3Di.degrees(d)));$(this).animate({rotate3Di:degrees},options);};})(jQuery);(function($){$('a[data-reveal-id]').live('click',function(e){e.preventDefault();var modalLocation=$(this).attr('data-reveal-id');$('#'+modalLocation).reveal($(this).data());});$.fn.reveal=function(options){var defaults={animation:'fadeAndPop',animationspeed:500,closeonbackgroundclick:false,dismissmodalclass:'close-button'};var options=$.extend({},defaults,options);return this.each(function(){var modal=$(this),topMeasure=parseInt(modal.css('top')),topOffset=modal.height()+topMeasure,locked=false,modalBG=$('.modal');if(modalBG.length==0){modalBG=$('<div class="modal" />').insertAfter(modal);}modal.bind('reveal:open',function(){modalBG.unbind('click.modalEvent');$('.'+options.dismissmodalclass).unbind('click.modalEvent');if(!locked){lockModal();if(options.animation=='fadeAndPop'){modal.css({'top':$(document).scrollTop()-topOffset,'opacity':0,'display':'block'});modalBG.fadeIn(options.animationspeed/2);modal.delay(options.animationspeed/2).animate({'top':$(document).scrollTop()+topMeasure+'px','opacity':1},options.animationspeed,unlockModal());}if(options.animation=='fade'){modal.css({'opacity':0,'display':'block','top':$(document).scrollTop()+topMeasure});modalBG.fadeIn(options.animationspeed/2);modal.delay(options.animationspeed/2).animate({'opacity':1},options.animationspeed,unlockModal());}if(options.animation=='none'){modal.css({'display':'block','top':$(document).scrollTop()+topMeasure});modalBG.css({'display':'block'});unlockModal();}}modal.unbind('reveal:open');});modal.bind('reveal:close',function(){if(!locked){lockModal();if(options.animation=='fadeAndPop'){modalBG.delay(options.animationspeed).fadeOut(options.animationspeed);modal.animate({'top':$(document).scrollTop()-topOffset+'px','opacity':0},options.animationspeed/2,function(){modal.css({'top':topMeasure,'opacity':1,'display':'none'});unlockModal();});}if(options.animation=='fade'){modalBG.delay(options.animationspeed).fadeOut(options.animationspeed);modal.animate({'opacity':0},options.animationspeed,function(){modal.css({'opacity':1,'display':'none','top':topMeasure});unlockModal();});}if(options.animation=='none'){modal.css({'display':'none','top':topMeasure});modalBG.css({'display':'none'});}}modal.unbind('reveal:close');});modal.trigger('reveal:open');var closeButton=$('.'+options.dismissmodalclass).bind('click.modalEvent',function(){modal.trigger('reveal:close');});if(options.closeonbackgroundclick){modalBG.css({'cursor':'pointer'});modalBG.bind('click.modalEvent',function(){modal.trigger('reveal:close');});}$('body').keyup(function(e){if(e.which===27){modal.trigger('reveal:close');}});function unlockModal(){locked=false;}function lockModal(){locked=true;}});};})(jQuery);(function($){function getTransformProperty(element){var properties=['transform','WebkitTransform','msTransform','MozTransform','OTransform'];var p;while(p=properties.shift()){if(typeof element.style[p]!='undefined'){return p;}}return'transform';}var _propsObj=null;var proxied=$.fn.css;$.fn.css=function(arg,val){if(_propsObj===null){if(typeof $.cssProps!='undefined'){_propsObj=$.cssProps;}else{if(typeof $.props!='undefined'){_propsObj=$.props;}else{_propsObj={};}}}if(typeof _propsObj['transform']=='undefined'&&(arg=='transform'||(typeof arg=='object'&&typeof arg['transform']!='undefined'))){_propsObj['transform']=getTransformProperty(this.get(0));}if(_propsObj['transform']!='transform'){if(arg=='transform'){arg=_propsObj['transform'];if(typeof val=='undefined'&&jQuery.style){return jQuery.style(this.get(0),arg);}}else{if(typeof arg=='object'&&typeof arg['transform']!='undefined'){arg[_propsObj['transform']]=arg['transform'];delete arg['transform'];}}}return proxied.apply(this,arguments);};})(jQuery);function getWindowHeight(){var windowHeight=0;if(typeof(window.innerHeight)=='number'){windowHeight=window.innerHeight;}else{if(document.documentElement&&document.documentElement.clientHeight){windowHeight=document.documentElement.clientHeight;}else{if(document.body&&document.body.clientHeight){windowHeight=document.body.clientHeight;}}}return windowHeight;}function setContent(){if(document.getElementById){var windowHeight=getWindowHeight();if(windowHeight>0){var contentElement=$('.business-card'),contentHeight=contentElement.filter(':visible')[0].offsetHeight;contentElement.each(function(){var thisCard=this;if(windowHeight-contentHeight>0){thisCard.style.top=((windowHeight/2)-(contentHeight/2))+'px';}});}}}function mySideChange(front){if(front){$('#front').show();$('#back').hide();}else{$('#front').hide();$('#back').show();}}$(document).ready(function(){setContent();window.onresize=function(){setContent();};var fadeInIcon=function(){$('.flip').delay(1000).fadeIn(1000);};fadeInIcon();$('#toback, #front .flip').click(function(){$('.flip').hide();$('.business-card').stop().rotate3Di('toggle',750,{direction:'clockwise',sideChange:mySideChange});fadeInIcon();return false;});$('#tofront, #back .flip').click(function(){$('.flip').hide();$('.business-card').stop().rotate3Di('unflip',750,{sideChange:mySideChange});fadeInIcon();return false;});$('#recent-projects LI A').click(function(){return false;});$('#back FORM').submit(function(){var name=$('#name',$(this)).val(),email=$('#email',$(this)).val(),message=$('#message',$(this)).val(),formData='name='+name+'&email='+email+'&message='+message,button=$('BUTTON',$(this));button.text('Sending message');setTimeout(function(){$.ajax({type:'POST',url:'includes/sendmail.php',data:formData,success:function(data){button.text('Message Sent');setTimeout(function(){$('#tofront').click();setTimeout(function(){$('#name').val('');$('#email').val('');$('#message').val('');button.text('Send');},800);},2000);},error:function(){button.text('Sending Failed');}});},500);return false;});});
