(function(a){a.fn.quicksand=function(b,c){var e={duration:750,easing:"swing",attribute:"data-id",adjustHeight:"auto",useScaling:true,enhancement:function(a){},selector:"> *",dx:0,dy:0};a.extend(e,c);if(a.browser.msie||typeof a.fn.scale=="undefined"){e.useScaling=false}var f;if(typeof arguments[1]=="function"){var f=arguments[1]}else if(typeof (arguments[2]=="function")){var f=arguments[2]}return this.each(function(c){var g;var h=[];var i=a(b).clone();var j=a(this);var k=a(this).css("height");var l;var m=false;var n=a(j).offset();var o=[];var p=a(this).find(e.selector);if(a.browser.msie&&a.browser.version.substr(0,1)<7){j.html("").append(i);return}var q=0;var r=function(){if(!q){q=1;$toDelete=j.find("> *");j.prepend(w.find("> *"));$toDelete.remove();if(m){j.css("height",l)}e.enhancement(j);if(typeof f=="function"){f.call(this)}}};var s=j.offsetParent();var t=s.offset();if(s.css("position")=="relative"){if(s.get(0).nodeName.toLowerCase()=="body"){}else{t.top+=parseFloat(s.css("border-top-width"))||0;t.left+=parseFloat(s.css("border-left-width"))||0}}else{t.top-=parseFloat(s.css("border-top-width"))||0;t.left-=parseFloat(s.css("border-left-width"))||0;t.top-=parseFloat(s.css("margin-top"))||0;t.left-=parseFloat(s.css("margin-left"))||0}if(isNaN(t.left)){t.left=0}if(isNaN(t.top)){t.top=0}t.left-=e.dx;t.top-=e.dy;j.css("height",a(this).height());p.each(function(b){o[b]=a(this).offset()});a(this).stop();var u=0;var v=0;p.each(function(b){a(this).stop();var c=a(this).get(0);if(c.style.position=="absolute"){u=-e.dx;v=-e.dy}else{u=e.dx;v=e.dy}c.style.position="absolute";c.style.margin="0";c.style.top=o[b].top-parseFloat(c.style.marginTop)-t.top+v+"px";c.style.left=o[b].left-parseFloat(c.style.marginLeft)-t.left+u+"px"});var w=a(j).clone();var x=w.get(0);x.innerHTML="";x.setAttribute("id","");x.style.height="auto";x.style.width=j.width()+"px";w.append(i);w.insertBefore(j);w.css("opacity",0);x.style.zIndex=-1;x.style.margin="0";x.style.position="absolute";x.style.top=n.top-t.top+"px";x.style.left=n.left-t.left+"px";if(e.adjustHeight==="dynamic"){j.animate({height:w.height()},e.duration,e.easing)}else if(e.adjustHeight==="auto"){l=w.height();if(parseFloat(k)