// jQuery Scripts de iLeoDesigns para HermanosVadell 2.0

var scrolltotop={setting:{startline:100,scrollto:0,scrollduration:1e3,fadeduration:[500,100]},controlHTML:'<img src="images/up.gif" class="clear2" style="width:28px; height:29px"/>',controlattrs:{offsetx:30,offsety:125},anchorkeyword:"#top",state:{isvisible:false,shouldvisible:false},scrollup:function(){var a=this;!a.cssfixedsupport&&a.$control.css({opacity:0});var b=isNaN(a.setting.scrollto)?a.setting.scrollto:parseInt(a.setting.scrollto);if(typeof b=="string"&&jQuery("#"+b).length==1)b=jQuery("#"+b).offset().top;else b=0;a.$body.animate({scrollTop:b},a.setting.scrollduration)},keepfixed:function(){var a=this,b=jQuery(window),c=b.scrollLeft()+b.width()-a.$control.width()-a.controlattrs.offsetx,d=b.scrollTop()+b.height()-a.$control.height()-a.controlattrs.offsety;a.$control.css({left:c+"px",top:d+"px"})},togglecontrol:function(){var a=this,b=jQuery(window).scrollTop();!a.cssfixedsupport&&a.keepfixed();a.state.shouldvisible=b>=a.setting.startline?true:false;if(a.state.shouldvisible&&!a.state.isvisible){a.$control.stop().animate({opacity:1},a.setting.fadeduration[0]);a.state.isvisible=true}else if(a.state.shouldvisible==false&&a.state.isvisible){a.$control.stop().animate({opacity:0},a.setting.fadeduration[1]);a.state.isvisible=false}},init:function(){jQuery(document).ready(function(b){var c="CSS1Compat",a=scrolltotop,d=document.all;a.cssfixedsupport=!d||d&&document.compatMode==c&&window.XMLHttpRequest;a.$body=window.opera?document.compatMode==c?b("html"):b("body"):b("html,body");a.$control=b('<div id="topcontrol">'+a.controlHTML+"</div>").css({position:a.cssfixedsupport?"fixed":"absolute",bottom:a.controlattrs.offsety,right:a.controlattrs.offsetx,opacity:0,cursor:"pointer"}).attr({title:""}).click(function(){a.scrollup();return false}).appendTo("body");document.all&&!window.XMLHttpRequest&&a.$control.text()!=""&&a.$control.css({width:a.$control.width()});a.togglecontrol();b('a[href="'+a.anchorkeyword+'"]').click(function(){a.scrollup();return false});b(window).bind("scroll resize",function(){a.togglecontrol()})})}};scrolltotop.init();$(document).ready(function(){var a="slow",b="opacity";$(function(){$(".clear").css(b,"0.9");$(".clear").hover(function(){$(this).stop().animate({opacity:1},a)},function(){$(this).stop().animate({opacity:.9},a)})});$(function(){var c=".clearpro";$(c).css(b,"1.0");$(c).hover(function(){$(this).stop().animate({opacity:.5},a)},function(){$(this).stop().animate({opacity:1.1},a)})});$(function(){$(".clear2").css(b,"0.8");$(".clear2").hover(function(){$(this).stop().animate({opacity:1},"fast")},function(){$(this).stop().animate({opacity:.8},a)})});$(function(){$(".clear3").css(b,"0.8");$(".clear3").hover(function(){$(this).stop().animate({opacity:1},a)},function(){$(this).stop().animate({opacity:.9},a)})});$(function(){$(".c").css(b,"0.7");$(".c").hover(function(){$(this).stop().animate({opacity:1},"fast")},function(){$(this).stop().animate({opacity:.7},a)})});$(".faded").each(function(a){$(this).delay(a*800).fadeIn()});$(".next").each(function(a){$(this).delay(a*999).fadeIn()});$(".prev").each(function(a){$(this).delay(a*999).fadeIn()})});$(function(){var a=".clearmini";$(a).css("opacity","0.7");$(a).hover(function(){$(this).stop().animate({opacity:1},"fast")},function(){$(this).stop().animate({opacity:.7},"slow")})});jQuery.extend(jQuery.easing,{easeInQuad:function(e,a,b,c,d){return c*(a/=d)*a+b},easeOutQuad:function(e,a,b,c,d){return-c*(a/=d)*(a-2)+b},easeInOutQuad:function(e,a,b,c,d){return(a/=d/2)<1?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b},easeInCubic:function(e,a,b,c,d){return c*(a/=d)*a*a+b},easeOutCubic:function(e,a,b,c,d){return c*((a=a/d-1)*a*a+1)+b},easeInOutCubic:function(e,a,b,c,d){return(a/=d/2)<1?c/2*a*a*a+b:c/2*((a-=2)*a*a+2)+b},easeInQuart:function(e,a,b,c,d){return c*(a/=d)*a*a*a+b},easeOutQuart:function(e,a,b,c,d){return-c*((a=a/d-1)*a*a*a-1)+b},easeInOutQuart:function(e,a,b,c,d){return(a/=d/2)<1?c/2*a*a*a*a+b:-c/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(e,a,b,c,d){return c*(a/=d)*a*a*a*a+b},easeOutQuint:function(e,a,b,c,d){return c*((a=a/d-1)*a*a*a*a+1)+b},easeInOutQuint:function(e,a,b,c,d){return(a/=d/2)<1?c/2*a*a*a*a*a+b:c/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(e,d,b,a,c){return-a*Math.cos(d/c*(Math.PI/2))+a+b},easeOutSine:function(e,d,a,b,c){return b*Math.sin(d/c*(Math.PI/2))+a},easeInOutSine:function(e,d,a,b,c){return-b/2*(Math.cos(Math.PI*d/c)-1)+a},easeInExpo:function(e,b,a,c,d){return b==0?a:c*Math.pow(2,10*(b/d-1))+a},easeOutExpo:function(e,d,a,b,c){return d==c?a+b:b*(-Math.pow(2,-10*d/c)+1)+a},easeInOutExpo:function(e,a,b,c,d){return a==0?b:a==d?b+c:(a/=d/2)<1?c/2*Math.pow(2,10*(a-1))+b:c/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(e,a,b,c,d){return-c*(Math.sqrt(1-(a/=d)*a)-1)+b},easeOutCirc:function(e,a,b,c,d){return c*Math.sqrt(1-(a=a/d-1)*a)+b},easeInOutCirc:function(e,a,b,c,d){return(a/=d/2)<1?-c/2*(Math.sqrt(1-a*a)-1)+b:c/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(h,d,e,a,f){var g=1.70158,b=0,c=a;if(d==0)return e;if((d/=f)==1)return e+a;if(!b)b=f*.3;if(c<Math.abs(a)){c=a;var g=b/4}else var g=b/(2*Math.PI)*Math.asin(a/c);return-(c*Math.pow(2,10*(d-=1))*Math.sin((d*f-g)*2*Math.PI/b))+e},easeOutElastic:function(h,d,e,a,f){var g=1.70158,b=0,c=a;if(d==0)return e;if((d/=f)==1)return e+a;if(!b)b=f*.3;if(c<Math.abs(a)){c=a;var g=b/4}else var g=b/(2*Math.PI)*Math.asin(a/c);return c*Math.pow(2,-10*d)*Math.sin((d*f-g)*2*Math.PI/b)+a+e},easeInOutElastic:function(h,a,e,b,f){var g=1.70158,c=0,d=b;if(a==0)return e;if((a/=f/2)==2)return e+b;if(!c)c=f*.3*1.5;if(d<Math.abs(b)){d=b;var g=c/4}else var g=c/(2*Math.PI)*Math.asin(b/d);return a<1?-.5*d*Math.pow(2,10*(a-=1))*Math.sin((a*f-g)*2*Math.PI/c)+e:d*Math.pow(2,-10*(a-=1))*Math.sin((a*f-g)*2*Math.PI/c)*.5+b+e},easeInBack:function(f,b,c,d,e,a){if(a==undefined)a=1.70158;return d*(b/=e)*b*((a+1)*b-a)+c},easeOutBack:function(f,b,c,d,e,a){if(a==undefined)a=1.70158;return d*((b=b/e-1)*b*((a+1)*b+a)+1)+c},easeInOutBack:function(f,a,c,d,e,b){if(b==undefined)b=1.70158;return(a/=e/2)<1?d/2*a*a*(((b*=1.525)+1)*a-b)+c:d/2*((a-=2)*a*(((b*=1.525)+1)*a+b)+2)+c},easeInBounce:function(e,d,c,a,b){return a-jQuery.easing.easeOutBounce(e,b-d,0,a,b)+c},easeOutBounce:function(g,a,d,e,f){var c=7.5625,b=2.75;return(a/=f)<1/b?e*c*a*a+d:a<2/b?e*(c*(a-=1.5/b)*a+.75)+d:a<2.5/b?e*(c*(a-=2.25/b)*a+.9375)+d:e*(c*(a-=2.625/b)*a+.984375)+d},easeInOutBounce:function(e,c,d,b,a){return c<a/2?jQuery.easing.easeInBounce(e,c*2,0,b,a)*.5+d:jQuery.easing.easeOutBounce(e,c*2-a,0,b,a)*.5+b*.5+d}});(function(a){var g="hover",d=false,h="function",c="tipsy",f="string",e="original-title",b="title";function i(a){(a.attr(b)||typeof a.attr(e)!=f)&&a.attr(e,a.attr(b)||"").removeAttr(b)}function j(c,d){var b=this;b.$element=a(c);b.options=d;b.enabled=true;i(b.$element)}j.prototype={show:function(){var b=this,k=b.getTitle();if(k&&b.enabled){var e=b.tip();e.find(".tipsy-inner")[b.options.html?"html":"text"](k);e[0].className=c;e.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).appendTo(document.body);var d=a.extend({},b.$element.offset(),{width:b.$element[0].offsetWidth,height:b.$element[0].offsetHeight}),g=e[0].offsetWidth,j=e[0].offsetHeight,i=typeof b.options.gravity==h?b.options.gravity.call(b.$element[0]):b.options.gravity,f;switch(i.charAt(0)){case"n":f={top:d.top+d.height+b.options.offset,left:d.left+d.width/2-g/2};break;case"s":f={top:d.top-j-b.options.offset,left:d.left+d.width/2-g/2};break;case"e":f={top:d.top+d.height/2-j/2,left:d.left-g-b.options.offset};break;case"w":f={top:d.top+d.height/2-j/2,left:d.left+d.width+b.options.offset}}if(i.length==2)if(i.charAt(1)=="w")f.left=d.left+d.width/2-15;else f.left=d.left+d.width/2-g+15;e.css(f).addClass("tipsy-"+i);if(b.options.fade)e.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:b.options.opacity});else e.css({visibility:"visible",opacity:b.options.opacity})}},hide:function(){if(this.options.fade)this.tip().stop().fadeOut(function(){a(this).remove()});else this.tip().remove()},getTitle:function(){var c,d=this.$element,a=this.options;i(d);var c,a=this.options;if(typeof a.title==f)c=d.attr(a.title==b?e:a.title);else if(typeof a.title==h)c=a.title.call(d[0]);c=(""+c).replace(/(^\s*|\s*$)/,"");return c||a.fallback},tip:function(){if(!this.$tip)this.$tip=a('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"/></div>');return this.$tip},validate:function(){!this.$element[0].parentNode&&this.hide()},enable:function(){this.enabled=true},disable:function(){this.enabled=d},toggleEnabled:function(){this.enabled=!this.enabled}};a.fn.tipsy=function(b){var d=this;if(b===true)return d.data(c);else if(typeof b==f)return d.data(c)[b]();b=a.extend({},a.fn.tipsy.defaults,b);function e(e){var d=a.data(e,c);if(!d){d=new j(e,a.fn.tipsy.elementOptions(e,b));a.data(e,c,d)}return d}function l(){var a=e(this);a.hoverState="in";if(b.delayIn==0)a.show();else setTimeout(function(){a.hoverState=="in"&&a.show()},b.delayIn)}function m(){var a=e(this);a.hoverState="out";if(b.delayOut==0)a.hide();else setTimeout(function(){a.hoverState=="out"&&a.hide()},b.delayOut)}!b.live&&d.each(function(){e(this)});if(b.trigger!="manual"){var h=b.live?"live":"bind",k=b.trigger==g?"mouseenter":"focus",i=b.trigger==g?"mouseleave":"blur";d[h](k,l)[h](i,m)}return d};a.fn.tipsy.defaults={delayIn:0,delayOut:0,fade:d,fallback:"",gravity:"n",html:d,live:d,offset:0,opacity:.8,title:b,trigger:g};a.fn.tipsy.elementOptions=function(c,b){return a.metadata?a.extend({},b,a(c).metadata()):b};a.fn.tipsy.autoNS=function(){return a(this).offset().top>a(document).scrollTop()+a(window).height()/2?"s":"n"};a.fn.tipsy.autoWE=function(){return a(this).offset().left>a(document).scrollLeft()+a(window).width()/2?"e":"w"}})(jQuery);$(function(){var m="div#container",h=null,k="slow",f="div#controls",d="ltr",e="left",b="rtl",a="div#container_w",c="div#viewer",j=".link";$("#viewer").removeClass("js-disabled");$("<div>").attr("id","container_w").css({position:"absolute"}).width($(j).length*137).height(213).appendTo(c);$(j).each(function(){$(this).appendTo(a)});var i=$(j).length*2500,l=(parseInt($(a).width())+parseInt($(c).width()))/i,n=b;n==b?$(a).css(e,$(c).width()).addClass(b):$(a).css(e,0-$(a).width()).addClass(d);var g=function(a,e,j){if(j==b){a.removeClass(d).addClass(b);a.animate({left:"-"+a.width()+"px"},e,"linear",function(){$(this).css({left:$("div#imageScroller").width(),right:""});g($(this),i,b);$(f).length>0?$(f).slideUp(k).remove():h})}else{a.removeClass(b).addClass(d);a.animate({left:$(c).width()+"px"},e,"linear",function(){$(this).css({left:0-$(m).width()});g($(this),i,d);$(f).length>0?$(f).slideUp(k).remove():h})}};g($(a),i,n);$("a.link").live("mouseover",function(){$(a).stop(true);var b=$(this).attr("title");$("p#title").length==0?$("<p>").attr("id","title").text(b).appendTo(f):$("p#title").text(b)});$("a.link").live("mouseout",function(i){i.relatedTarget==h?h:i.relatedTarget.id!="controls"?$(f).slideUp(k).remove():h;var b=parseInt($(a).width())+parseInt($(c).width()),j=$(a).hasClass(d)?b-(parseInt($(m).css(e))+parseInt($(a).width())):b-(parseInt($(c).width())-parseInt($(a).css(e))),n=j/l;g($(a),n,$(a).attr("class"))});$("#ltr").live("click",function(){$(a).stop(true);$(a).removeClass(b).addClass(d);var f=parseInt($(a).width())+parseInt($(c).width()),h=f-(parseInt($(a).css(e))+parseInt($("div#container_W").width())),i=h/l;g($(a),i,d)});$("#rtl").live("click",function(){$(a).stop(true);$(a).removeClass(d).addClass(b);var f=parseInt($(a).width())+parseInt($(c).width()),h=f-(parseInt($(c).width())-parseInt($(a).css(e))),i=h/l;g($(a),i,b)})});jQuery.preloadCssImages=function(f){var e="/";for(var f=jQuery.extend({statusTextEl:null,statusBarEl:null},f),a=[],d=0,c=document.styleSheets,b=0;b<c.length;b++){var h="",q=c[b].href?c[b].href:"window.location.href",p=q.split(e);p.pop();var k=p.join(e);if(k!="")k+=e;if(c[b].cssRules)for(var o=c[b].cssRules,i=0;i<o.length;i++)if(c[b].cssRules[i].constructor=="CSSImportRule")for(var n=c[b].cssRules[i].styleSheet.cssRules,m=0;m<n.length;m++)h+=n[m].cssText;else h+=o[i].cssText;else if(c[b].imports.length>0)for(var l=0;l<c[b].imports.length;l++)h+=c[b].imports[l].cssText;else h+=c[b].cssText;var j=h.match(/[^\(]+\.(gif|jpg|jpeg|png)/g),g=0;if(j!=null&&j.length>0&&j!=""){var r=jQuery.makeArray(j);jQuery(r).each(function(){var b=this;a[d]=new Image;a[d].src=b.charAt(0)==e||b.indexOf("http://")>-1?b:k+b;if(a[d].src.lastIndexOf("http://")>0)a[d].src=a[d].src.split("%22")[1];jQuery(a[d]).load(function(){g++;f.statusTextEl&&jQuery(f.statusTextEl).html('<span class="numLoaded">'+g+'</span> of <span class="numTotal">'+a.length+'</span> loaded (<span class="percentLoaded">'+(g/a.length*100).toFixed(0)+'%</span>) <span class="currentImg">Now Loading: <span>'+a[g-1].src.split(e)[a[g-1].src.split(e).length-1]+"</span></span>");if(f.statusBarEl){var b=jQuery(f.statusBarEl).width();jQuery(f.statusBarEl).css("background-position",-(b-(b*g/a.length).toFixed(0))+"px 50%")}});d++})}}return a};
