/*
 * jQuery Easing v1.1.1 - http://gsgd.co.uk/sandbox/jquery.easing.php
 *
 * Uses the built in easing capabilities added in jQuery 1.1
 * to offer multiple easing options
 *
 * Copyright (c) 2007 George Smith
 * Licensed under the MIT License:
 *   http://www.opensource.org/licenses/mit-license.php
 */

jQuery.extend({easing:{easein:function(x,t,b,c,d){return c*(t/=d)*t+b},easeout:function(x,t,b,c,d){return-c*t*t/(d*d)+2*c*t/d+b},linear:function(x,t,b,c,d){return c*t/d+b}}});


/*
 *
 * Deal listing plugin v1.4
 *
 * © 2009 Copyright, all right reserved, Tom Flídr, Czech (tomflidr@gmail.com)
 * This SOFTWARE is under the MIT (http://en.wikipedia.org/wiki/MIT_License)
 * jQuery 1.2.6+
 *
*/

(function($){$.fn.dealListing=function(w){var x='px';var y='rel';var z='block';var A='none';var B='height';var C='auto';var D='visible';var E='hidden';var F='.';var G=false;var H=['.deal-listing-item','.deal-listing-item-head','deal-listing-item-head-active','deal-listing-item-head-focus','deal-listing-item-head-plus','deal-listing-item-head-minus','.deal-listing-item-detail','deal-listing-item-detail-packed','deal-listing-item-detail-unpacked','deal-listing-item-detail-animated',500,450,500,'easein','easeout','.deal-listing-show-hide-all','.deal-listing','deal-listing-done',function(){},function(){},function(){},function(){}];var I=$.extend(H,w);var J=function(a,b,c){a.removeClass(I[9]).css(B,C).attr(y,a.outerHeight());b.children(F+I[4]).map(function(){$(this).removeClass(I[4]).addClass(I[5])});if(c==null){var d=I[19];d(a.parent(I[0]))}};var K=function(a,b,c){a.removeClass(I[9]).hide().css({position:'absolute',visibility:E}).css(B,C).attr(y,a.outerHeight());b.children(F+I[5]).map(function(){$(this).removeClass(I[5]).addClass(I[4])});if(c==null){var d=I[21];d(a.parent(I[0]))}};var L=function(m,n,o){var p=m.parent().children(I[6]);G=false;if(p.hasClass(I[9])){p.stop();G=true};if((p.hasClass(I[7])&&o==null)||o){if(o==null){var q=I[18];q(p.parent(I[0]))};p.removeClass(I[7]).addClass(I[8]).addClass(I[9]).css({display:z,height:((G)?p.outerHeight()+x:0+x),position:'relative',visibility:D}).animate({height:p.attr(y)+x},((o)?1:I[10]),I[13],function(){J(p,m,o)});if(n&&I[12]>0){var r=function(a){var b=$(document).scrollLeft();var c=$(document).scrollTop();var d=Math.round(a-c);var e=Math.round(1000/25);var f=Math.round(I[12]/e);var g=0;var h=Math.PI/2;var i=(h-g)/f;var j=g;var k=function(){if(j>=h){clearInterval(l);window.scrollTo(b,a)}else{currentScrollTop=c+(Math.round(Math.sin(j)*d*100)/100);window.scrollTo(b,currentScrollTop);j+=i}};var l=setInterval(k,e)};var s=$(window).height()>((m.outerHeight()*2)+parseInt(p.attr(y)));var t=(m.offset().top+(m.outerHeight()*2)+parseInt(p.attr(y)))-$(window).height()>$(document).scrollTop();var u=m.offset().top<$(document).scrollTop();if(s&&t){r(m.offset().top+(m.outerHeight()*2)+parseInt(p.attr(y))-$(window).height())}else if(!s&&t){r(m.offset().top)}else if(u){r(m.offset().top)}}}else if((p.hasClass(I[8])&&o==null)||!o){if(o==null){var v=I[20];v(p.parent(I[0]))};p.removeClass(I[8]).addClass(I[7]).addClass(I[9]).animate({height:0+x},((!o)?I[11]:1),I[14],function(){K(p,m,o)})}};$(I[15]).attr('href','javascript:void(0);').click(function(){var a=false;$(this).children().each(function(i){if($(this).css('display')==A){if(i==1){a=true};$(this).show()}else{$(this).hide()}});$(I[0]).each(function(){$(this).children(I[1]).each(function(){if(a){$(this).focus()};L($(this),false,a);if(!a){$(this).blur()}})});$(this).focus();if(a){var b=I[19];$(I[0]).each(function(){b($(this))})}else{var c=I[21];$(I[0]).each(function(){c($(this))})}});$(I[0]).each(function(){var a=$(this).children(I[1]);var b=$(this).children(I[6]);b.map(function(){$(this).css({display:z});$(this).attr(y,b.height());if($(this).css('visibility')==E){$(this).css({display:A})}});a.click(function(){$(this).focus();L($(this),true,null)});$(document).keyup(function(e){if(e.keyCode==13||e.keyCode==32){$(I[2]).trigger('click')}});a.hover(function(){$(this).addClass(I[2])},function(){$(this).removeClass(I[2])}).focus(function(){$(this).addClass(I[3])}).blur(function(){if(b.hasClass(I[7])){$(this).removeClass(I[3])}});$(I[16]).addClass(I[17])})}})(jQuery);
