/*!
 jquery.dmxzone_animations_pack.js
 Version 1.2
 Copyright (c) 2010 DMXzone.com
*/
(function(e){function y(a){return a&&typeof a=="object"}function q(a){return typeof a=="string"||y(a)&&(a instanceof String||"substr"in a)}function s(a,b){if(q(a)){if(e.isFunction(window[a]))return window[a];if(q(a)&&/^\s*function\s*([\w\d_\$]+)?\s*\(/i.test(a)&&/\};?\s*$/.test(a)){var c;try{c=(new Function("return "+a))()}catch(f){alert("getFunction:\n\n"+f.message)}if(e.isFunction(c))return c}}if(e.isFunction(a))return a;if(b)return function(){return a};return a}function n(a){return String(a).replace(/\-(\w)/g, function(b,c){return c.toUpperCase()})}function i(a){return String(a).replace(/([A-Z])/g,function(b,c){return"-"+c.toLowerCase()})}function d(a){if(!d.cache){d.cache={};d.style=document.createElement("div").style}var b=n(a);if(!(b in d.cache)){var c=d.style,f,g="",j=["Moz","Webkit","O","Khtml","Ms"];if(c[a]!==undefined)g=a;else if(c[b]!==undefined)g=b;else for(a=0;a<j.length;a++){f=j[a]+b.charAt(0).toUpperCase()+b.substr(1);if(c[f]!==undefined){g=f;break}f=i(f);if(c[f]!==undefined){g=f;break}}d.cache[b]= g}return d.cache[b]}function w(a){var b={};jQuery.each(a,function(c,f){if(c.charAt(0)=="!"||c in w.customProperties)b[c]=f;else{var g=jQuery.cssProps?jQuery.cssProps[c]||d(c):d(c);if(g)b[g]=f}});return b}function A(a,b,c){a=parseFloat(a);var f=parseFloat(b);if(!isNaN(a)&&!isNaN(f))switch(c){case "+=":return a+f;case "-=":return a-f;case "*=":return a*f;case "/=":return a!==0?a/f:f;case "%=":return a!==0?a%f:f}return b}function B(a){a=w(jQuery.extend({},a));var b={},c;for(c in a){b[c]=s(a[c]);if(q(b[c]))if(/^step:/.test(b[c]))try{steps.push(new Function("fx", b[c].replace(/^step:/,"")))}catch(f){alert("dmxAnimate:\n\n"+f.message)}finally{delete b[c]}}return b}function C(a,b){var c=parseFloat(a),f=parseFloat(b);if(!isNaN(c)&&!isNaN(f)){var g=Math.min(c,f);return g+(Math.max(c,f)-g)*Math.random()}return Math.random()}function z(a){if(a.indexOf("~")>0)a=a.replace(/((-?\d+(\.\d+)?)~(-?\d+(\.\d+)?))/g,function(b,c,f,g,j){return C(f,j)});return a}function F(){var a=[],b;for(b in e.easing)typeof e.easing[b]=="function"&&a.push(b);a=e.makeArray(a);return a[Math.round(C(0, a.length-1))]}function D(a){if(a.elem.style&&a.elem.style[a.prop]!==null)a.elem.style[a.prop]=Math.round(a.now);else a.elem[a.prop]=Math.round(a.now)}function G(a,b,c,f,g){if(c&&typeof c=="object")return c;var j=d(b),m=f||f===0?f:e.curCSS(a,j,true),h=c,t=/z-?index|font-?weight|opacity|zoom|line-?height|scale[xy]?|rotate|skew[xy]?/i;h=h=="scroll"||window.scroll&&h==scroll?"scroll":s(h);if(!g&&h!="scroll"&&e.isFunction(h))h=h.call(a,j,m);h=e.trim(String(h));if(h.indexOf("~")>0)h=z(h);if(/^(top|left|bottom|right|translateX|translateY)$/.test(j))if(/^[(top|left|bottom|right|center)]+$/i.test(h)){a= distanceTo(a,h,window,j);switch(j.toLowerCase()){case "top":case "translatey":h="+="+a.y;break;case "left":case "translatex":h="+="+a.x;break;case "bottom":h="-="+a.y;break;case "right":h="-="+a.x}}var v=0,r=/([\+\-\/\*%]=)((-?\d+(\.\d+)?)(\w+|%)?)/g;return h.replace(r,function(k,l,o,p,u,x){k=p;if(l)if(o=String(m).match(r)){o=o[v++]||0;k=A(o,p,l)}else if(parseFloat(m)+""!="NaN")k=A(m,p,l);if(x)if(parseFloat(h)+""!="NaN"&&!t.test(j))k+=x||"px";return k})}function E(a,b,c,f){var g=e.extend({loop:1, stop:false,clearQueue:false,goToEnd:false,delay:0,queue:true,onStart:null,step:null,complete:null,duration:1E3,easing:"swing"},f),j=jQuery(a),m=[];g.step=s(g.step,true);g.complete=s(g.complete,true);var h=g.complete;g.complete=function(){h.call(this);if(g.loop=="infinity"||!isNaN(g.loop)&&--g.loop>0)E(a,b,c,e.extend(f,{loop:g.loop}))};var t=g.step;g.step=function(k,l){t.call(this,k,l);jQuery.each(m,function(o,p){p(l)})};var v=B(b),r=B(c);v.dummy=0;r.dummy=1;g.stop&&j.stop(!!g.clearQueue,!!g.goToEnd); j.delay(g.delay||0).queue("fx",function(){e(this).css(v);H.call(e(this),r,e.extend(true,{},g,{queue:g.queue!=false}));e(this).dequeue()})}w.customProperties=function(a){a=a.split(/\s*,\s*/);for(var b=a.length,c={};b;)c[a[--b]]=1;return c}("transform, matrix, matrix3d, rotate, rotateX, rotateY, rotateZ, rotate3d, scale, scaleX, scaleY, scaleZ, scale3d, skew, skewX, skewY, translate, translateX, translateY, translateZ, translate3d, perspective, opacity, dummy, path, transformOrign");e(function(){if(typeof e("body")[0].onmouseenter== "undefined"){e("[onmouseenter]").unbind("mouseenter.dmxzone").bind("mouseenter.dmxzone",function(){eval(e(this).attr("onmouseenter"))});e("[onmouseleave]").unbind("mouseleave.dmxzone").bind("mouseleave.dmxzone",function(){eval(e(this).attr("onmouseleave"))})}});if(typeof e.fn.delay!="function")e.fn.delay=function(a,b){a=jQuery.fx?jQuery.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var c=this;setTimeout(function(){jQuery.dequeue(c,b)},a)})};e.fx.step.zIndex=D;e.fx.step.outlineOffset= D;e.fx.step.zoom=function(a){if(a.elem.style&&a.elem.style[a.prop]!==null)a.elem.style[a.prop]=a.now;else a.elem[a.prop]=a.now};e.fx.step.dummy=function(){};e.extend(true,{util:{css:{realName:d,vendorize:w,isSupported:function(a){a=String(a);return document.createElement("div").style[a]!==undefined||!!d(a)}}}});var H=function(a,b,c,f){var g=y(b)?q(b.duration)?/^(slow|fast|normal)$/i.test(b.duration)?b.duration:Math.ceil(z(b.duration)):b.duration:q(b)?/^(slow|fast|normal)$/i.test(b)?b:Math.ceil(z(b)): b;if(y(b))b.duration=g;else b=g;var j=jQuery.speed(b,c,f);if(j.easing=="random")j.easing=F();var m=w(jQuery.extend({},a));return this[j.queue===false?"each":"queue"](function(){var h=jQuery.extend({},j),t,v=this.nodeType==1&&jQuery(this).is(":hidden"),r=this;h.overflow=null;for(t in m){if(m[t]=="hide"&&v||m[t]=="show"&&!v)return h.complete.call(this);if((t=="height"||t=="width")&&this.style){h.display=jQuery.css(this,"display");h.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY]}}if(h.overflow!== null)this.style.overflow="hidden";h.curAnim=jQuery.extend({},m);jQuery.each(m,function(k,l){var o=new jQuery.fx(r,h,k),p=o.cur(true)||0;l=G(r,k,l,p);if(/toggle|show|hide/.test(l))o[l=="toggle"?v?"show":"hide":l](m);else if(e.cssHooks&&k in e.cssHooks&&e.cssHooks[k].step)o.custom(e.css(r,k),l,"");else{var u=l.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/);if(u){var x=parseFloat(u[2]);u=u[3]||"px";if(u!="px"){r.style[k]=(x||1)+u;p=(x||1)/o.cur(true)*p;r.style[k]=p+u}o.custom(p,x,u)}else o.custom(p,l, "")}});return true})};e.extend(true,{dmxAnimate:E})})(jQuery); function distanceTo(e,y,q){e=jQuery(e);var s=e.offset(),n={},i=jQuery(q||window);q={x:0,y:0};i.width();i.height();jQuery(window).scrollLeft();jQuery(window).scrollTop();var d={innerBox:{width:i.width(),height:i.height()},scrollTop:i.scrollTop(),scrollLeft:i.scrollLeft()};if(!i[0].nodeType||i[0].nodeType!==1)$.extend(d,{paddingBox:{width:d.innerBox.width,height:d.innerBox.height},borderBox:{width:d.innerBox.width,height:d.innerBox.height},marginBox:{width:d.innerBox.width,height:d.innerBox.height}, offset:{top:0,left:0},position:{top:0,left:0},borderWidth:{top:0,right:0,bottom:0,left:0}});else{$.extend(d,{paddingBox:{width:i.innerWidth(),height:i.innerHeight()},borderBox:{width:i.outerWidth(),height:i.outerHeight()},marginBox:{width:i.outerWidth({margin:true}),height:i.outerHeight({margin:true})},offset:i.offset(),position:i.position()});d.borderWidth={top:parseInt(i.css("borderTopWidth"),10),right:parseInt(i.css("borderRightWidth"),10),bottom:parseInt(i.css("borderBottomWidth"),10),left:parseInt(i.css("borderLeftWidth"), 10)};if(isNaN(d.borderWidth.top))d.borderWidth.top=0;if(isNaN(d.borderWidth.right))d.borderWidth.right=0;if(isNaN(d.borderWidth.bottom))d.borderWidth.bottom=0;if(isNaN(d.borderWidth.left))d.borderWidth.left=0}d.absoluteInnerVisibleBox={width:d.paddingBox.width,height:d.paddingBox.height,top:d.offset.top+d.borderWidth.top+d.scrollTop,left:d.offset.left+d.borderWidth.left+d.scrollLeft};i=parseFloat(e.css("translateX").replace(/^\s*translate[xy]?\s*\(/i,""));var w=parseFloat(e.css("translateY").replace(/^\s*translate[xy]?\s*\(/i, ""));if(jQuery.browser.mozilla){s.left+=i;s.top+=w}switch(String(y).toLowerCase()){case "center":n.x=d.absoluteInnerVisibleBox.left+(d.absoluteInnerVisibleBox.width/2-e.outerWidth()/2);n.y=d.absoluteInnerVisibleBox.top+(d.absoluteInnerVisibleBox.height/2-e.outerHeight()/2);break;case "top":n.y=d.absoluteInnerVisibleBox.top;break;case "left":n.x=d.absoluteInnerVisibleBox.left;break;case "right":n.x=d.absoluteInnerVisibleBox.left+d.absoluteInnerVisibleBox.width-e.outerWidth();break;case "bottom":n.y= d.absoluteInnerVisibleBox.top+d.absoluteInnerVisibleBox.height-e.outerHeight();break;default:return s}if("x"in n)q.x=n.x-s.left;if("y"in n)q.y=n.y-s.top;return q};
