/*
	jQuery Blend v1.0
	(c) 2009 Jack Moore - www.colorpowered.com - jack@colorpowered.com
	Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
*/
(function(a){a.fn.blend=function(b,d){var c=a.extend({},a.fn.blend.settings,b);a(this).each(function(){var n,e,i,l,o,m,r,k,g,p;n=a(this);e=a(c.target?c.target:this);if(e[0].style.position!="absolute"){e.css({position:"relative"})}if(!e.hasClass("hover")){e.wrapInner('<div style="position:relative" />')}o=e.css("background-image");m=e.css("background-repeat");p=e.css("background-color");k=e.css("background-position-x");g=e.css("background-position-y");r=e.css("background-position");e.addClass("hover");if(e.find(".jsblend").length===0){i=a('<div class="jsblend" />').css({position:"absolute",top:"0",left:"0",width:e.css("width"),height:e.css("height"),cursor:"pointer","background-image":e.css("background-image"),"background-repeat":e.css("background-repeat"),"background-position":e.css("background-position"),"background-position-x":e.css("background-position-x"),"background-position-y":e.css("background-position-y"),"background-color":e.css("background-color")});if(c.top){i.appendTo(e)}else{i.prependTo(e)}}else{i=e.find(".jsblend")}e.css({"background-image":o,"background-repeat":m,"background-position":r,"background-position-x":k,"background-position-y":g,"background-color":p});var f=false;var h=0;var j=c.opacity;if(c.reverse){h=c.opacity;j=0}i.css({opacity:h});function q(s){if(f){i.fadeTo(c.speed,s,function(){q(s==h?j:h)})}}if(c.pulse&&c.active){f=true;q(j)}else{if(c.pulse){n.hover(function(){f=true;q(j)},function(){f=false;i.stop(true).fadeTo(c.speed,h)})}else{n.hover(function(){i.stop().fadeTo(c.speed,j)},function(){i.stop().fadeTo(c.speed,h)})}}});return this};a.fn.blend.settings={speed:500,opacity:1,target:false,reverse:false,pulse:false,active:false,top:false}})(jQuery);