(function($){function isString(input){return typeof(input)=='string'}function isObject(input){return typeof(input)=='object'}function int_prop(fx){fx.elem.style[fx.prop]=parseInt(fx.now,10)+fx.unit}var throwError=function(message){throw({name:"jquery.flip.js plugin error",message:message})};var isIE6orOlder=function(){return(/*@cc_on!@*/false&&(typeof document.body.style.maxHeight==="undefined"))};var colors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]};var acceptHexColor=function(color){if(color&&color.indexOf("#")==-1&&color.indexOf("(")==-1){return"rgb("+colors[color].toString()+")"}else{return color}};$.extend($.fx.step,{borderTopWidth:int_prop,borderBottomWidth:int_prop,borderLeftWidth:int_prop,borderRightWidth:int_prop});$.fn.revertFlip=function(){return this.each(function(){var $this=$(this);$this.flip($this.data('flipRevertedSettings'))})};$.fn.flip=function(settings){return this.each(function(){var $this=$(this),flipObj,$clone,dirOption,dirOptions,newContent,ie6=isIE6orOlder();if($this.data('flipLock')){return false}var revertedSettings={direction:(function(direction){switch(direction){case"tb":return"bt";case"bt":return"tb";case"lr":return"rl";case"rl":return"lr";default:return"bt"}})(settings.direction),bgColor:acceptHexColor(settings.color)||"#999",color:acceptHexColor(settings.bgColor)||$this.css("background-color"),content:$this.html(),speed:settings.speed||500,onBefore:settings.onBefore||function(){},onEnd:settings.onEnd||function(){},onAnimation:settings.onAnimation||function(){}};$this.data('flipRevertedSettings',revertedSettings).data('flipLock',1).data('flipSettings',revertedSettings);flipObj={width:$this.width(),height:$this.height(),bgColor:acceptHexColor(settings.bgColor)||$this.css("background-color"),fontSize:$this.css("font-size")||"12px",direction:settings.direction||"tb",toColor:acceptHexColor(settings.color)||"#999",speed:settings.speed||500,top:$this.offset().top,left:$this.offset().left,target:settings.content||null,transparent:"transparent",dontChangeColor:settings.dontChangeColor||false,onBefore:settings.onBefore||function(){},onEnd:settings.onEnd||function(){},onAnimation:settings.onAnimation||function(){}};ie6&&(flipObj.transparent="#123456");$clone=$this.css("visibility","hidden").clone(true).data('flipLock',1).appendTo("body").html("").css({visibility:"visible",position:"absolute",left:flipObj.left,top:flipObj.top,margin:0,zIndex:9999,"-webkit-box-shadow":"0px 0px 0px #000","-moz-box-shadow":"0px 0px 0px #000"});var defaultStart=function(){return{backgroundColor:flipObj.transparent,fontSize:0,lineHeight:0,borderTopWidth:0,borderLeftWidth:0,borderRightWidth:0,borderBottomWidth:0,borderTopColor:flipObj.transparent,borderBottomColor:flipObj.transparent,borderLeftColor:flipObj.transparent,borderRightColor:flipObj.transparent,background:"none",borderStyle:'solid',height:0,width:0}};var defaultHorizontal=function(){var waist=(flipObj.height/100)*25;var start=defaultStart();start.width=flipObj.width;return{"start":start,"first":{borderTopWidth:0,borderLeftWidth:waist,borderRightWidth:waist,borderBottomWidth:0,borderTopColor:'#999',borderBottomColor:'#999',top:(flipObj.top+(flipObj.height/2)),left:(flipObj.left-waist)},"second":{borderBottomWidth:0,borderTopWidth:0,borderLeftWidth:0,borderRightWidth:0,borderTopColor:flipObj.transparent,borderBottomColor:flipObj.transparent,top:flipObj.top,left:flipObj.left}}};var defaultVertical=function(){var waist=(flipObj.height/100)*25;var start=defaultStart();start.height=flipObj.height;return{"start":start,"first":{borderTopWidth:waist,borderLeftWidth:0,borderRightWidth:0,borderBottomWidth:waist,borderLeftColor:'#999',borderRightColor:'#999',top:flipObj.top-waist,left:flipObj.left+(flipObj.width/2)},"second":{borderTopWidth:0,borderLeftWidth:0,borderRightWidth:0,borderBottomWidth:0,borderLeftColor:flipObj.transparent,borderRightColor:flipObj.transparent,top:flipObj.top,left:flipObj.left}}};dirOptions={"tb":function(){var d=defaultHorizontal();d.start.borderTopWidth=flipObj.height;d.start.borderTopColor=flipObj.bgColor;d.second.borderBottomWidth=flipObj.height;d.second.borderBottomColor=flipObj.toColor;return d},"bt":function(){var d=defaultHorizontal();d.start.borderBottomWidth=flipObj.height;d.start.borderBottomColor=flipObj.bgColor;d.second.borderTopWidth=flipObj.height;d.second.borderTopColor=flipObj.toColor;return d},"lr":function(){var d=defaultVertical();d.start.borderLeftWidth=flipObj.width;d.start.borderLeftColor=flipObj.bgColor;d.second.borderRightWidth=flipObj.width;d.second.borderRightColor=flipObj.toColor;return d},"rl":function(){var d=defaultVertical();d.start.borderRightWidth=flipObj.width;d.start.borderRightColor=flipObj.bgColor;d.second.borderLeftWidth=flipObj.width;d.second.borderLeftColor=flipObj.toColor;return d}};dirOption=dirOptions[flipObj.direction]();ie6&&(dirOption.start.filter="chroma(color="+flipObj.transparent+")");newContent=function(){var target=flipObj.target;return target};$clone.queue(function(){flipObj.onBefore($clone,$this);$clone.html('').css(dirOption.start);$clone.dequeue()});$clone.animate(dirOption.first,flipObj.speed);$clone.queue(function(){flipObj.onAnimation($clone,$this);$clone.dequeue()});$clone.animate(dirOption.second,flipObj.speed);$clone.queue(function(){if(!flipObj.dontChangeColor){$this.css({backgroundColor:flipObj.toColor})}$this.css({visibility:"visible"});var nC=newContent();if(nC){$this.empty().append(nC)}else{$this.html(nC)}$clone.remove();flipObj.onEnd($clone,$this);$this.removeData('flipLock');$clone.dequeue()})})}})(jQuery);(function($){function getTransformProperty(element){var properties=['transform','WebkitTransform','MozTransform','msTransform','OTransform'];var p;while(p=properties.shift()){if(element.style[p]!==undefined){return p}}return false}$.cssHooks['rotate']={get:function(elem,computed,extra){var property=getTransformProperty(elem);if(property){return elem.style[property].replace(/.*rotate\((.*)deg\).*/,'$1')}else{return''}},set:function(elem,value){var property=getTransformProperty(elem);if(property){value=parseInt(value);$(elem).data('rotatation',value);if(value==0){elem.style[property]=''}else{elem.style[property]='rotate('+value%360+'deg)'}}else{return''}}};$.fx.step['rotate']=function(fx){$.cssHooks['rotate'].set(fx.elem,fx.now)}})(jQuery);if(!window.console||!console.firebug){var names=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"];window.console={};for(var i=0;i<names.length;++i)window.console[names[i]]=function(){}}$(function(){$('body').removeClass('no-js');$('a[rel=external]').click(function(e){window.open($(this).attr('href'));e.preventDefault()});var content=$('#content').children();$('#content').remove();console.log(content);$('#card, #pocket').css('position','absolute');console.log($(document).height());if($(document).height()>520){$('#card').position({my:'center',at:'center',of:document,offset:'0 -70'});$('#pocket').position({my:'center',at:'center',of:document})}else{$('body').addClass('no-center');$('#card').position({my:'center top',at:'center top',of:document});$('#pocket').position({my:'center top',at:'center top',of:document});$('#card').css('top',90);$('#pocket').css('top',80)}var posTop=$('#card').position().top;var posLeft=$('#card').position().left;$('#card').css('rotate',85);$('#card').bind('click',function(e){$(this).unbind('click');$(this).animate({'top':[posTop-220,'linear'],'rotate':[0,'easeInCubic']},500,function(){$(this).css({'z-index':4,'cursor':'default'});$('#card:hover').css('box-shadow','none');$(this).flip({direction:'tb',color:'#fff',content:content,onEnd:function(){$('#card').removeAttr('href').removeAttr('title').addClass('content').animate({'top':posTop-60,'left':posLeft-70,'width':440,'height':400},500,function(){$('a[rel=external]').click(function(e){window.open(this.href);e.preventDefault()});$('span.email').each(function(){var email=$(this).html().replace('(at)','@').replace('(dot)','.');$(this).after('<a href="mailto:'+email+'">'+email+'</a>').remove()});$('.content nav a').click(function(e){$('nav .active').removeClass('active');var lien=$(this).addClass('active');$('section.active').removeClass('active').slideUp(500,function(){$('section#'+$(lien).attr('href')).addClass('active').slideDown(1000)});e.preventDefault()})})}})});e.preventDefault()})});
