/*! tinyLightbox parallel animation extension 2.5 - Plugin for jQuery
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 * Copyright (c) 2008 Oleg Slobodskoi (ajaxsoft.de)
 */
(function(a){a.fn.tinyLightbox.parallel=function(g){var c=this,f=null;this.start=function(h){g.boxData.top=e();g.$overlay.animate({opacity:"show"},g.s.speed,g.s.easing,function(){g.$box.css({visibility:"visible",left:g.boxData.left,top:g.boxData.top});h();a(window).bind("scroll resize",b)})};this.animate=function(h){g.$box.animate({height:g.boxData.height,width:g.boxData.width,left:g.boxData.left,top:e()},g.s.speed,g.s.easing,function(){g.$image.css("background-image","url("+g.path+")").fadeIn(g.s.speed,function(){d(h)})})};this.prepare=function(h){g.$bar.slideUp(g.s.speed,function(){g.$image.fadeOut(g.s.speed,h)})};this.limit=function(h){if(h){h()}};this.close=function(h){this.prepare(function(){g.$box.fadeOut(g.s.speed,function(){g.$overlay.fadeOut(g.s.speed,h);a(window).unbind("scroll resize",b)})})};function e(){return g.docData.scrollTop+(a(window).height()-g.boxData.height)/2}function b(){if(f){clearTimeout(f)}f=setTimeout(function(){g.$image.css("opacity",0);g.$bar.slideUp(100);var h=e();g.$box.animate({height:h+g.boxData.height-g.boxData.top,width:g.boxData.width,left:g.boxData.left},g.s.speed,g.s.easing,function(){a(this).animate({top:h,height:g.boxData.height},g.s.speed,g.s.easing,function(){g.$image.css("opacity",1);d()})})},300)}function d(h){g.$bar.css({top:e()+g.boxData.height+g.boxData.borderWidth*2,left:g.boxData.left,width:g.boxData.width}).slideDown(g.s.speed,h)}}})(jQuery);
