/*
 Advanced CSS Animator
 Version: 1.0.5
 (c) 2011 DMXzone.com
 @build 14-09-2011 13:10:06
*/
(function(c){function n(a){return a&&typeof a=="object"}function k(a){return typeof a=="string"||n(a)&&(a instanceof String||"substr"in a)}function m(a,h){if(k(a)){if(c.isFunction(window[a]))return window[a];if(k(a)&&/^\s*function\s*([\w\d_\$]+)?\s*\(/i.test(a)&&/\};?\s*$/.test(a)){var b;try{b=(new Function("return "+a))()}catch(d){alert("getFunction:\n\n"+d.message)}if(c.isFunction(b))return b}}if(c.isFunction(a))return a;if(h)return function(){return a};return a}function j(a){return String(a).replace(/\-(\w)/g,
function(a,b){return b.toUpperCase()})}function f(a){return String(a).replace(/([A-Z])/g,function(a,b){return"-"+b.toLowerCase()})}function b(a){if(!b.cache)b.cache={},b.style=document.createElement("div").style;var h=j(a);if(!(h in b.cache)){var c=b.style,d,g="",e=["Moz","Webkit","O","Khtml","Ms"];if(c[a]!==void 0)g=a;else if(c[h]!==void 0)g=h;else for(a=0;a<e.length;a++){d=e[a]+h.charAt(0).toUpperCase()+h.substr(1);if(c[d]!==void 0){g=d;break}d=f(d);if(c[d]!==void 0){g=d;break}}b.cache[h]=g}return b.cache[h]}
function o(a){var h={};jQuery.each(a,function(a,c){if(a.charAt(0)=="!"||a in o.customProperties)h[a]=c;else{var g=jQuery.cssProps?jQuery.cssProps[a]||b(a):b(a);g&&(h[g]=c)}});return h}function s(a,b,c){var a=parseFloat(a),d=parseFloat(b);if(!isNaN(a)&&!isNaN(d))switch(c){case "+=":return a+d;case "-=":return a-d;case "*=":return a*d;case "/=":return a!==0?a/d:d;case "%=":return a!==0?a%d:d}return b}function t(a,b){var c=parseFloat(a),d=parseFloat(b);if(!isNaN(c)&&!isNaN(d)){var g=Math.min(c,d);return g+
(Math.max(c,d)-g)*Math.random()}return Math.random()}function q(a){a.indexOf("~")>0&&(a=a.replace(/((-?\d+(\.\d+)?)~(-?\d+(\.\d+)?))/g,function(a,b,c,g,e){return t(c,e)}));return a}function y(){var a=[],b;for(b in c.easing)typeof c.easing[b]=="function"&&a.push(b);a=c.makeArray(a);return a[Math.round(t(0,a.length-1))]}function u(a){a.elem.style&&a.elem.style[a.prop]!==null?a.elem.style[a.prop]=Math.round(a.now):a.elem[a.prop]=Math.round(a.now)}function r(a,h,f,d,g){if(f&&typeof f=="object")return f;
var e=b(h),l=d||d===0?d:c.curCSS(a,e,!0),i=f,j=/z-?index|font-?weight|opacity|zoom|line-?height|scale[xy]?|rotate|skew[xy]?/i,i=i=="scroll"||window.scroll&&i==scroll?"scroll":m(i);!g&&i!="scroll"&&c.isFunction(i)&&(i=i.call(a,e,l));if(typeof i!=="string")return i;i.indexOf("~")>0&&(i=q(i));if(/^(top|left|bottom|right|translateX|translateY)$/.test(e)&&/^[(top|left|bottom|right|center)]+$/i.test(i))switch(a=distanceTo(a,i,window,e),e.toLowerCase()){case "top":case "translatey":i="+="+a.y;break;case "left":case "translatex":i=
"+="+a.x;break;case "bottom":i="-="+a.y;break;case "right":i="-="+a.x}var k=0,p=/([\+\-\/\*%]=)((-?\d+(\.\d+)?)(\w+|%)?)/g;return i.replace(p,function(a,b,c,h,d,f){a=h;b&&((c=String(l).match(p))?(c=c[k++]||0,a=s(c,h,b)):parseFloat(l)+""!="NaN"&&(a=s(l,h,b)));f&&parseFloat(i)+""!="NaN"&&!j.test(e)&&(a+=f||"px");return a})}function w(a,b,f,d){function g(a){var a=o(jQuery.extend({},a)),b={},c;for(c in a)if(b[c]=m(a[c]),k(b[c])&&/^step:/.test(b[c]))try{i.push(new Function("fx",b[c].replace(/^step:/,"")))}catch(h){alert("dmxAnimate:\n\n"+
h.message)}finally{delete b[c]}return b}var e=c.extend({loop:1,stop:!1,clearQueue:!1,goToEnd:!1,delay:0,queue:!0,onStart:null,step:null,complete:null,duration:1E3,easing:"swing"},d),l=jQuery(a),i=[];e.step=m(e.step,!0);e.complete=m(e.complete,!0);var j=e.complete;e.complete=function(){j.call(this);(e.loop=="infinity"||!isNaN(e.loop)&&--e.loop>0)&&w(a,b,f,c.extend(d,{loop:e.loop}))};var n=e.step;e.step=function(a,b){n.call(this,a,b);jQuery.each(i,function(a,c){c(b)})};var p=g(b),v=g(f);p.dummy=0;v.dummy=
1;e.stop&&l.stop(!!e.clearQueue,!!e.goToEnd);l.delay(e.delay||0).queue("fx",function(){c(this).css(p);z.call(c(this),v,c.extend(!0,{},e,{queue:e.queue!=!1}));c(this).dequeue()})}o.customProperties=function(a){for(var a=a.split(/\s*,\s*/),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");
c(function(){typeof c("body")[0].onmouseenter=="undefined"&&(c("[onmouseenter]").unbind("mouseenter.dmxzone").bind("mouseenter.dmxzone",function(){eval(c(this).attr("onmouseenter"))}),c("[onmouseleave]").unbind("mouseleave.dmxzone").bind("mouseleave.dmxzone",function(){eval(c(this).attr("onmouseleave"))}))});if(typeof c.fn.delay!="function")c.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)})};
c.fx.step.zIndex=u;c.fx.step.outlineOffset=u;c.fx.step.zoom=function(a){a.elem.style&&a.elem.style[a.prop]!==null?a.elem.style[a.prop]=a.now:a.elem[a.prop]=a.now};c.fx.step.dummy=function(){};c.extend(!0,{util:{css:{realName:b,vendorize:o,isSupported:function(a){a=String(a);return document.createElement("div").style[a]!==void 0||!!b(a)}}}});var x=jQuery.fn.css;jQuery.fn.css=function(a,b){var f=this;if(b!==void 0||a&&typeof a=="object")return this.each(function(d,g){if(a&&typeof a=="object"){for(var e in a)if(a[e]==
"hide"||a[e]=="show")c(g)[a[e]=="hide"?"hide":"show"](0),delete a[e];for(e in a)c(g).css(e,r(g,e,a[e]))}else x.call(f,a,r(g,a,b))});return x.call(this,a)};var A=jQuery.curCSS;jQuery.curCSS=function(a,b){if(b=="zoom"&&!jQuery.support.opacity){var c=jQuery.attr(a.style,"zoom");return c===""?"1":c}return A.apply(jQuery,arguments)};var z=function(a,b,f,d){var g=n(b)?k(b.duration)?/^(slow|fast|normal)$/i.test(b.duration)?b.duration:Math.ceil(q(b.duration)):b.duration:k(b)?/^(slow|fast|normal)$/i.test(b)?
b:Math.ceil(q(b)):b;n(b)?b.duration=g:b=g;var e=jQuery.speed(b,f,d);if(e.easing=="random")e.easing=y();var l=o(jQuery.extend({},a));return this[e.queue===!1?"each":"queue"](function(){var i;var a=jQuery.extend({},e),b=this.nodeType===1,f=b&&jQuery(this).is(":hidden"),d,g,h,j=this;a.overflow=null;a.animatedProperties={};for(h in l){d=jQuery.camelCase(h);h!==d&&(l[d]=l[h],delete l[h]);g=l[d];jQuery.isArray(g)?(a.animatedProperties[d]=g[1],i=l[d]=g[0],g=i):a.animatedProperties[d]=a.specialEasing&&a.specialEasing[d]||
a.easing||"swing";if(g==="hide"&&f||g==="show"&&!f)return a.complete.call(this);if(b&&(d==="height"||d==="width"))if(a.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],jQuery.css(this,"display")==="inline"&&jQuery.css(this,"float")==="none")jQuery.support.inlineBlockNeedsLayout?(d=defaultDisplay(this.nodeName),d==="inline"?this.style.display="inline-block":(this.style.display="inline",this.style.zoom=1)):this.style.display="inline-block"}if(a.overflow!==null)this.style.overflow=
"hidden";a.curAnim=jQuery.extend({},l);jQuery.each(l,function(b,d){var e=new jQuery.fx(j,a,b),g=e.cur(!0)||0,d=r(j,b,d,g);if(/toggle|show|hide/.test(d))e[d=="toggle"?f?"show":"hide":d](l);else if(c.cssHooks&&b in c.cssHooks&&c.cssHooks[b].step)e.custom(c.css(j,b),d,"");else{var h=d.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/);if(h){var k=parseFloat(h[2]),h=h[3]||"px";h!="px"&&(j.style[b]=(k||1)+h,g*=(k||1)/e.cur(!0),j.style[b]=g+h);e.custom(g,k,h)}else e.custom(g,d,"")}});return!0})};c.extend(!0,
{dmxAnimate:w})})(jQuery);
function distanceTo(c,n,k){var c=jQuery(c),m=c.offset(),j={},f=jQuery(k||window),k={x:0,y:0};f.width();f.height();jQuery(window).scrollLeft();jQuery(window).scrollTop();var b={innerBox:{width:f.width(),height:f.height()},scrollTop:f.scrollTop(),scrollLeft:f.scrollLeft()};if(!f[0].nodeType||f[0].nodeType!==1)$.extend(b,{paddingBox:{width:b.innerBox.width,height:b.innerBox.height},borderBox:{width:b.innerBox.width,height:b.innerBox.height},marginBox:{width:b.innerBox.width,height:b.innerBox.height},
offset:{top:0,left:0},position:{top:0,left:0},borderWidth:{top:0,right:0,bottom:0,left:0}});else{$.extend(b,{paddingBox:{width:f.innerWidth(),height:f.innerHeight()},borderBox:{width:f.outerWidth(),height:f.outerHeight()},marginBox:{width:f.outerWidth({margin:!0}),height:f.outerHeight({margin:!0})},offset:f.offset(),position:f.position()});b.borderWidth={top:parseInt(f.css("borderTopWidth"),10),right:parseInt(f.css("borderRightWidth"),10),bottom:parseInt(f.css("borderBottomWidth"),10),left:parseInt(f.css("borderLeftWidth"),
10)};if(isNaN(b.borderWidth.top))b.borderWidth.top=0;if(isNaN(b.borderWidth.right))b.borderWidth.right=0;if(isNaN(b.borderWidth.bottom))b.borderWidth.bottom=0;if(isNaN(b.borderWidth.left))b.borderWidth.left=0}b.absoluteInnerVisibleBox={width:b.paddingBox.width,height:b.paddingBox.height,top:b.offset.top+b.borderWidth.top+b.scrollTop,left:b.offset.left+b.borderWidth.left+b.scrollLeft};var f=parseFloat(c.css("translateX").replace(/^\s*translate[xy]?\s*\(/i,"")),o=parseFloat(c.css("translateY").replace(/^\s*translate[xy]?\s*\(/i,
""));jQuery.browser.mozilla&&(m.left+=f,m.top+=o);switch(String(n).toLowerCase()){case "center":j.x=b.absoluteInnerVisibleBox.left+(b.absoluteInnerVisibleBox.width/2-c.outerWidth()/2);j.y=b.absoluteInnerVisibleBox.top+(b.absoluteInnerVisibleBox.height/2-c.outerHeight()/2);break;case "top":j.y=b.absoluteInnerVisibleBox.top;break;case "left":j.x=b.absoluteInnerVisibleBox.left;break;case "right":j.x=b.absoluteInnerVisibleBox.left+b.absoluteInnerVisibleBox.width-c.outerWidth();break;case "bottom":j.y=
b.absoluteInnerVisibleBox.top+b.absoluteInnerVisibleBox.height-c.outerHeight();break;default:return m}if("x"in j)k.x=j.x-m.left;if("y"in j)k.y=j.y-m.top;return k};

