/*
 * jquery.tools 1.1.1 - The missing UI library for the Web
 * 
 * Copyright (c) 2009 Tero Piirainen
 * http://flowplayer.org/tools/
 *
 * Dual licensed under MIT and GPL 2+ licenses
 * http://www.opensource.org/licenses
 * 
 */
(function(d){d.tools=d.tools||{};d.tools.tabs={version:"1.0.3",conf:{tabs:"a",current:"current",onBeforeClick:null,onClick:null,effect:"default",initialIndex:0,event:"click",api:false,rotate:false},addEffect:function(e,f){c[e]=f}};var c={"default":function(f,e){this.getPanes().hide().eq(f).show();e.call()},fade:function(g,e){var f=this.getConf(),h=f.fadeOutSpeed,j=this.getCurrentPane();if(h){j.fadeOut(h)}else{j.hide()}this.getPanes().eq(g).fadeIn(f.fadeInSpeed,e)},slide:function(f,e){this.getCurrentPane().slideUp(200);this.getPanes().eq(f).slideDown(400,e)},ajax:function(f,e){this.getPanes().eq(0).load(this.getTabs().eq(f).attr("href"),e)}};var b;d.tools.tabs.addEffect("horizontal",function(f,e){if(!b){b=this.getPanes().eq(0).width()}this.getCurrentPane().animate({width:0},function(){d(this).hide()});this.getPanes().eq(f).animate({width:b},function(){d(this).show();e.call()})});function a(g,h,f){var e=this,j=d(this),i;d.each(f,function(k,l){if(d.isFunction(l)){j.bind(k,l)}});d.extend(this,{click:function(k){var o=e.getCurrentPane();var l=g.eq(k);if(typeof k=="string"&&k.replace("#","")){l=g.filter("[href*="+k.replace("#","")+"]");k=Math.max(g.index(l),0)}if(f.rotate){var m=g.length-1;if(k<0){return e.click(m)}if(k>m){return e.click(0)}}if(!l.length){if(i>=0){return e}k=f.initialIndex;l=g.eq(k)}var n=d.Event("onBeforeClick");j.trigger(n,[k]);if(n.isDefaultPrevented()){return}if(k===i){return e}l.addClass(f.current);c[f.effect].call(e,k,function(){j.trigger("onClick",[k])});g.removeClass(f.current);l.addClass(f.current);i=k;return e},getConf:function(){return f},getTabs:function(){return g},getPanes:function(){return h},getCurrentPane:function(){return h.eq(i)},getCurrentTab:function(){return g.eq(i)},getIndex:function(){return i},next:function(){return e.click(i+1)},prev:function(){return e.click(i-1)},bind:function(k,l){j.bind(k,l);return e},onBeforeClick:function(k){return this.bind("onBeforeClick",k)},onClick:function(k){return this.bind("onClick",k)},unbind:function(k){j.unbind(k);return e}});g.each(function(k){d(this).bind(f.event,function(l){e.click(k);return l.preventDefault()})});if(location.hash){e.click(location.hash)}else{e.click(f.initialIndex)}h.find("a[href^=#]").click(function(){e.click(d(this).attr("href"))})}d.fn.tabs=function(i,f){var g=this.eq(typeof f=="number"?f:0).data("tabs");if(g){return g}if(d.isFunction(f)){f={onBeforeClick:f}}var h=d.extend({},d.tools.tabs.conf),e=this.length;f=d.extend(h,f);this.each(function(l){var j=d(this);var k=j.find(f.tabs);if(!k.length){k=j.children()}var m=i.jquery?i:j.children(i);if(!m.length){m=e==1?d(i):j.parent().find(i)}g=new a(k,m,f);j.data("tabs",g)});return f.api?g:this}})(jQuery);
(function(c){c.tools=c.tools||{};c.tools.tooltip={version:"1.1.1",conf:{effect:"toggle",fadeOutSpeed:"fast",tip:null,predelay:0,delay:30,opacity:1,lazy:undefined,position:["top","center"],offset:[0,0],cancelDefault:true,relative:false,events:{def:"mouseover,mouseout",input:"focus,blur",widget:"focus mouseover,blur mouseout"},api:false},addEffect:function(d,f,e){b[d]=[f,e]}};var b={toggle:[function(d){var e=this.getConf();this.getTip().css({opacity:e.opacity}).show();d.call()},function(d){this.getTip().hide();d.call()}],fade:[function(d){this.getTip().fadeIn(this.getConf().fadeInSpeed,d)},function(d){this.getTip().fadeOut(this.getConf().fadeOutSpeed,d)}]};function a(e,f){var o=this,j=c(this);e.data("tooltip",o);var k=e.next();if(f.tip){k=c(f.tip);if(k.length>1){k=e.nextAll(f.tip).eq(0);if(!k.length){k=e.parent().nextAll(f.tip).eq(0)}}}function n(t){var s=f.relative?e.position().top:e.offset().top,r=f.relative?e.position().left:e.offset().left,u=f.position[0];s-=k.outerHeight()-f.offset[0];r+=e.outerWidth()+f.offset[1];var p=k.outerHeight()+e.outerHeight();if(u=="center"){s+=p/2}if(u=="bottom"){s+=p}u=f.position[1];var q=k.outerWidth()+e.outerWidth();if(u=="center"){r-=q/2}if(u=="left"){r-=q}return{top:s,left:r}}var h=e.is(":input"),d=h&&e.is(":checkbox, :radio, select, :button"),g=e.attr("type"),m=f.events[g]||f.events[h?(d?"widget":"input"):"def"];m=m.split(/,\s*/);e.bind(m[0],function(q){var p=k.data("trigger");if(p&&p[0]!=this){k.hide()}q.target=this;o.show(q);k.hover(o.show,function(){o.hide(q)})});e.bind(m[1],function(p){o.hide(p)});if(!c.browser.msie&&!h){e.mousemove(function(){if(!o.isShown()){e.triggerHandler("mouseover")}})}if(f.opacity<1){k.css("opacity",f.opacity)}var l=0,i=e.attr("title");if(i&&f.cancelDefault){e.removeAttr("title");e.data("title",i)}c.extend(o,{show:function(q){if(q){e=c(q.target)}clearTimeout(k.data("timer"));if(k.is(":animated")||k.is(":visible")){return o}function p(){k.data("trigger",e);var s=n(q);if(f.tip&&i){k.html(e.data("title"))}var r=c.Event("onBeforeShow");j.trigger(r,[s]);if(r.isDefaultPrevented()){return o}s=n(q);k.css({position:"absolute",top:s.top,left:s.left});b[f.effect][0].call(o,function(){j.trigger("onShow")})}if(f.predelay){clearTimeout(l);l=setTimeout(p,f.predelay)}else{p()}return o},hide:function(q){clearTimeout(k.data("timer"));clearTimeout(l);if(!k.is(":visible")){return}function p(){var r=c.Event("onBeforeHide");j.trigger(r);if(r.isDefaultPrevented()){return}b[f.effect][1].call(o,function(){j.trigger("onHide")})}if(f.delay&&q){k.data("timer",setTimeout(p,f.delay))}else{p()}return o},isShown:function(){return k.is(":visible, :animated")},getConf:function(){return f},getTip:function(){return k},getTrigger:function(){return e},bind:function(p,q){j.bind(p,q);return o},onHide:function(p){return this.bind("onHide",p)},onBeforeShow:function(p){return this.bind("onBeforeShow",p)},onShow:function(p){return this.bind("onShow",p)},onBeforeHide:function(p){return this.bind("onBeforeHide",p)},unbind:function(p){j.unbind(p);return o}});c.each(f,function(p,q){if(c.isFunction(q)){o.bind(p,q)}})}c.prototype.tooltip=function(d){var e=this.eq(typeof d=="number"?d:0).data("tooltip");if(e){return e}var f=c.extend(true,{},c.tools.tooltip.conf);if(c.isFunction(d)){d={onBeforeShow:d}}else{if(typeof d=="string"){d={tip:d}}}d=c.extend(true,f,d);if(typeof d.position=="string"){d.position=d.position.split(/,?\s/)}if(d.lazy!==false&&(d.lazy===true||this.length>20)){this.one("mouseover",function(g){e=new a(c(this),d);e.show(g)})}else{this.each(function(){e=new a(c(this),d)})}return d.api?e:this}})(jQuery);
(function(b){var a=b.tools.tooltip;a.effects=a.effects||{};a.effects.slide={version:"1.0.0"};b.extend(a.conf,{direction:"up",bounce:false,slideOffset:10,slideInSpeed:200,slideOutSpeed:200,slideFade:!b.browser.msie});var c={up:["-","top"],down:["+","top"],left:["-","left"],right:["+","left"]};b.tools.tooltip.addEffect("slide",function(d){var f=this.getConf(),g=this.getTip(),h=f.slideFade?{opacity:f.opacity}:{},e=c[f.direction]||c.up;h[e[1]]=e[0]+"="+f.slideOffset;if(f.slideFade){g.css({opacity:0})}g.show().animate(h,f.slideInSpeed,d)},function(e){var g=this.getConf(),i=g.slideOffset,h=g.slideFade?{opacity:0}:{},f=c[g.direction]||c.up;var d=""+f[0];if(g.bounce){d=d=="+"?"-":"+"}h[f[1]]=d+"="+i;this.getTip().animate(h,g.slideOutSpeed,function(){b(this).hide();e.call()})})})(jQuery);
(function(c){c.tools=c.tools||{};c.tools.scrollable={version:"1.1.1",conf:{size:5,vertical:false,speed:400,keyboard:true,keyboardSteps:null,disabledClass:"disabled",hoverClass:null,clickable:true,activeClass:"active",easing:"swing",loop:false,items:".items",item:null,prev:".prev",next:".next",prevPage:".prevPage",nextPage:".nextPage",api:false}};var d,a=0;function b(q,o,m){var t=this,r=c(this),e=!o.vertical,f=q.children(),l=0,j;if(!d){d=t}c.each(o,function(u,v){if(c.isFunction(v)){r.bind(u,v)}});if(f.length>1){f=c(o.items,q)}function n(v){var u=c(v);return m==1||u.length==1||o.globalNav?u:q.parent().find(v)}q.data("finder",n);var g=n(o.prev),i=n(o.next),h=n(o.prevPage),p=n(o.nextPage);c.extend(t,{getIndex:function(){return l},getClickIndex:function(){var u=t.getItems();return u.index(u.filter("."+o.activeClass))},getConf:function(){return o},getSize:function(){return t.getItems().size()},getPageAmount:function(){return Math.ceil(this.getSize()/o.size)},getPageIndex:function(){return Math.ceil(l/o.size)},getNaviButtons:function(){return g.add(i).add(h).add(p)},getRoot:function(){return q},getItemWrap:function(){return f},getItems:function(){return f.children(o.item)},getVisibleItems:function(){return t.getItems().slice(l,l+o.size)},seekTo:function(u,y,v){if(u<0){u=0}if(l===u){return t}if(y===undefined){y=o.speed}if(c.isFunction(y)){v=y;y=o.speed}if(u>t.getSize()-o.size){return o.loop?t.begin():this.end()}var w=t.getItems().eq(u);if(!w.length){return t}var x=c.Event("onBeforeSeek");r.trigger(x,[u]);if(x.isDefaultPrevented()){return t}function z(){if(v){v.call(t)}r.trigger("onSeek",[u])}if(e){f.animate({left:-w.position().left},y,o.easing,z)}else{f.animate({top:-w.position().top},y,o.easing,z)}d=t;l=u;return t},move:function(w,v,u){j=w>0;return this.seekTo(l+w,v,u)},next:function(v,u){return this.move(1,v,u)},prev:function(v,u){return this.move(-1,v,u)},movePage:function(y,x,w){j=y>0;var u=o.size*y;var v=l%o.size;if(v>0){u+=(y>0?-v:o.size-v)}return this.move(u,x,w)},prevPage:function(v,u){return this.movePage(-1,v,u)},nextPage:function(v,u){return this.movePage(1,v,u)},setPage:function(v,w,u){return this.seekTo(v*o.size,w,u)},begin:function(v,u){j=false;return this.seekTo(0,v,u)},end:function(v,u){j=true;var w=this.getSize()-o.size;return w>0?this.seekTo(w,v,u):t},reload:function(){r.trigger("onReload");return t},bind:function(u,v){r.bind(u,v);return t},onBeforeSeek:function(u){return this.bind("onBeforeSeek",u)},onSeek:function(u){return this.bind("onSeek",u)},onReload:function(u){return this.bind("onReload",u)},unbind:function(u){r.unbind(u);return t},focus:function(){d=t;return t},click:function(w){var x=t.getItems().eq(w),u=o.activeClass,v=o.size;if(w<0||w>=t.getSize()){return t}if(v==1){if(o.loop){return t.next()}if(w===0||w==t.getSize()-1){j=(j===undefined)?true:!j}return j===false?t.prev():t.next()}if(v==2){if(w==l){w--}t.getItems().removeClass(u);x.addClass(u);return t.seekTo(w,time,fn)}if(!x.hasClass(u)){t.getItems().removeClass(u);x.addClass(u);var z=Math.floor(v/2);var y=w-z;if(y>t.getSize()-v){y=t.getSize()-v}if(y!==w){return t.seekTo(y)}}return t}});g.addClass(o.disabledClass).click(function(){t.prev()});i.click(function(){t.next()});p.click(function(){t.nextPage()});h.addClass(o.disabledClass).click(function(){t.prevPage()});t.onSeek(function(v,u){if(u===0){g.add(h).addClass(o.disabledClass)}else{g.add(h).removeClass(o.disabledClass)}if(u>=t.getSize()-o.size){i.add(p).addClass(o.disabledClass)}else{i.add(p).removeClass(o.disabledClass)}});var k=o.hoverClass,s="keydown."+Math.random().toString().substring(10);t.onReload(function(){if(k){t.getItems().hover(function(){c(this).addClass(k)},function(){c(this).removeClass(k)})}if(o.clickable){t.getItems().each(function(u){c(this).unbind("click.scrollable").bind("click.scrollable",function(v){if(c(v.target).is("a")){return}return t.click(u)})})}if(o.keyboard){c(document).unbind(s).bind(s,function(u){if(u.altKey||u.ctrlKey){return}if(o.keyboard!="static"&&d!=t){return}var v=o.keyboardSteps;if(e&&(u.keyCode==37||u.keyCode==39)){t.move(u.keyCode==37?-v:v);return u.preventDefault()}if(!e&&(u.keyCode==38||u.keyCode==40)){t.move(u.keyCode==38?-v:v);return u.preventDefault()}return true})}else{c(document).unbind(s)}});t.reload()}c.fn.scrollable=function(e){var f=this.eq(typeof e=="number"?e:0).data("scrollable");if(f){return f}var g=c.extend({},c.tools.scrollable.conf);e=c.extend(g,e);e.keyboardSteps=e.keyboardSteps||e.size;a+=this.length;this.each(function(){f=new b(c(this),e);c(this).data("scrollable",f)});return e.api?f:this}})(jQuery);
(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.circular={version:"0.5.1",conf:{api:false,clonedClass:"cloned"}};b.fn.circular=function(e){var d=b.extend({},a.plugins.circular.conf),c;b.extend(d,e);this.each(function(){var i=b(this).scrollable(),n=i.getItems(),k=i.getConf(),f=i.getItemWrap(),j=0;if(i){c=i}if(n.length<k.size){return false}n.slice(0,k.size).each(function(o){b(this).clone().appendTo(f).click(function(){i.click(n.length+o)}).addClass(d.clonedClass)});var l=b.makeArray(n.slice(-k.size)).reverse();b(l).each(function(o){b(this).clone().prependTo(f).click(function(){i.click(-o-1)}).addClass(d.clonedClass)});var m=f.children(k.item);var h=k.hoverClass;if(h){m.hover(function(){b(this).addClass(h)},function(){b(this).removeClass(h)})}function g(o){var p=m.eq(o);if(k.vertical){f.css({top:-p.position().top})}else{f.css({left:-p.position().left})}}g(k.size);b.extend(i,{move:function(s,r,p,q){var u=j+s+k.size;var t=u>i.getSize()-k.size;if(u<0||t){var o=j+k.size+(t?-n.length:n.length);g(o);u=o+s}if(q){m.removeClass(k.activeClass).eq(u+Math.floor(k.size/2)).addClass(k.activeClass)}if(u===j+k.size){return self}return i.seekTo(u,r,p)},begin:function(p,o){return this.seekTo(k.size,p,o)},end:function(p,o){return this.seekTo(n.length,p,o)},click:function(p,r,q){if(!k.clickable){return self}if(k.size==1){return this.next()}var s=p-j,o=k.activeClass;s-=Math.floor(k.size/2);return this.move(s,r,q,true)},getIndex:function(){return j},setPage:function(p,q,o){return this.seekTo(p*k.size+k.size,q,o)},getPageAmount:function(){return Math.ceil(n.length/k.size)},getPageIndex:function(){if(j<0){return this.getPageAmount()-1}if(j>=n.length){return 0}return(j+k.size)/k.size-1},getVisibleItems:function(){var o=j+k.size;return m.slice(o,o+k.size)}});i.onSeek(function(p,o){j=o-k.size;i.getNaviButtons().removeClass(k.disabledClass)});i.getNaviButtons().removeClass(k.disabledClass)});return d.api?c:this}})(jQuery);
(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.autoscroll={version:"1.0.1",conf:{autoplay:true,interval:3000,autopause:true,steps:1,api:false}};b.fn.autoscroll=function(d){if(typeof d=="number"){d={interval:d}}var e=b.extend({},a.plugins.autoscroll.conf),c;b.extend(e,d);this.each(function(){var g=b(this).scrollable();if(g){c=g}var i,f,h=true;g.play=function(){if(i){return}h=false;i=setInterval(function(){g.move(e.steps)},e.interval);g.move(e.steps)};g.pause=function(){i=clearInterval(i)};g.stop=function(){g.pause();h=true};if(e.autopause){g.getRoot().add(g.getNaviButtons()).hover(function(){g.pause();clearInterval(f)},function(){if(!h){f=setTimeout(g.play,e.interval)}})}if(e.autoplay){setTimeout(g.play,e.interval)}});return e.api?c:this}})(jQuery);
(function(b){var a=b.tools.scrollable;a.plugins=a.plugins||{};a.plugins.navigator={version:"1.0.1",conf:{navi:".navi",naviItem:null,activeClass:"active",indexed:false,api:false}};b.fn.navigator=function(d){var e=b.extend({},a.plugins.navigator.conf),c;if(typeof d=="string"){d={navi:d}}d=b.extend(e,d);this.each(function(){var i=b(this).scrollable(),f=i.getRoot(),l=f.data("finder").call(null,d.navi),g=null,k=i.getNaviButtons();if(i){c=i}i.getNaviButtons=function(){return k.add(l)};function j(){if(!l.children().length||l.data("navi")==i){l.empty();l.data("navi",i);for(var m=0;m<i.getPageAmount();m++){l.append(b("<"+(d.naviItem||"a")+"/>"))}g=l.children().each(function(n){b(this).click(function(o){i.setPage(n);return o.preventDefault()});if(d.indexed){b(this).text(n)}})}else{g=d.naviItem?l.find(d.naviItem):l.children();g.each(function(n){var o=b(this);o.click(function(p){i.setPage(n);return p.preventDefault()})})}g.eq(0).addClass(d.activeClass)}i.onSeek(function(n){var m=d.activeClass;g.removeClass(m).eq(i.getPageIndex()).addClass(m)});i.onReload(function(){j()});j();var h=g.filter("[href="+location.hash+"]");if(h.length){i.move(g.index(h))}});return d.api?c:this}})(jQuery);
/**
 * LightBox
*/
jQuery.bind = function(object, method){
var args = Array.prototype.slice.call(arguments, 2);
return function() {
var args2 = [this].concat(args, $.makeArray( arguments ));
return method.apply(object, args2);
};
};

(function($) {

cajadeluz = {
getOptions: function() {
return {
name: 'SLB',
zIndex: 65555,
color : 'black',
find: 'cajadeluz',
imagesdir : '/images/sexyimages',
background: 'bgSexy.png',
backgroundIE: 'bgSexy.gif',
closeButton : 'SexyClose.png',
displayed : 0,
modal : 0,
showDuration: 200,
showEffect: 'linear',
closeDuration : 400,
closeEffect : 'linear',
moveDuration: 800,
moveEffect: 'easeOutBack',
resizeDuration: 800,
resizeEffect: 'easeOutBack',
shake : { distance: 10,
duration: 100,
transition: 'easeInOutBack',
loops: 2
},
BoxStyles : { 'width' : 486, 'height': 320 },
Skin: { 'white' : { 'hexcolor': '#FFFFFF', 'captionColor': '#000000', 'background-color': '#000', 'opacity': 0.6 },
'black' : { 'hexcolor': '#000000', 'captionColor': '#FFFFFF', 'background-color': '#fff', 'opacity': 0.6 }}
};
},

initialize: function(options) {
this.options = $.extend(this.getOptions(), options);
this.options.OverlayStyles = $.extend(this.options.Skin[this.options.color], this.options.OverlayStyles || {});

var strBG = this.options.imagesdir+'/'+this.options.color+'/'+((((window.XMLHttpRequest == undefined) && (ActiveXObject != undefined)))?this.options.backgroundIE:this.options.background);
var name= this.options.name;

			$('body').append('<div id="'+name+'-Overlay"></div><div id="'+name+'-Wrapper"><div id="'+name+'-Background"></div><div id="'+name+'-Contenedor"><div id="'+name+'-Top" style="background-image: url('+strBG+')"><a id="'+name+'-CloseButton" href="#"><img src="'+this.options.imagesdir+'/'+this.options.color+'/'+this.options.closeButton+'" alt="Close"></a><div id="'+name+'-TopLeft" style="background-image: url('+strBG+')"></div></div><div id="'+name+'-Contenido"></div><div id="'+name+'-Bottom" style="background-image: url('+strBG+')"><div id="'+name+'-BottomRight" style="background-image: url('+strBG+')"><div id="'+name+'-Navegador"><strong id="'+name+'-Caption"></strong></div></div></div></div></div>');

this.Overlay= $('#'+name+'-Overlay');
this.Wrapper= $('#'+name+'-Wrapper');
this.Background = $('#'+name+'-Background');
this.Contenedor = $('#'+name+'-Contenedor');
this.Top= $('#'+name+'-Top');
this.CloseButton= $('#'+name+'-CloseButton');
this.Contenido= $('#'+name+'-Contenido');
this.bb = $('#'+name+'-Bottom');
this.innerbb= $('#'+name+'-BottomRight');
this.Nav= $('#'+name+'-Navegador');
this.Descripcion= $('#'+name+'-Caption');

this.Overlay.css({
'position': 'absolute',
'top' : 0,
'left': 0,
'opacity' : this.options.OverlayStyles['opacity'],
'height': $(document).height(),
'width' : $(document).width(),
'z-index' : this.options.zIndex,
'background-color': this.options.OverlayStyles['background-color']
}).hide();

this.Wrapper.css({
'z-index' : this.options.zIndex,
'top' : (-this.options.BoxStyles['height']-280)+'px',
'left': ( ($(document).width() - this.options.BoxStyles['width']) / 2)
}).hide();

this.Background.css({
'z-index' : this.options.zIndex + 1
});

this.Contenedor.css({
'position': 'absolute',
'width' : this.options.BoxStyles['width'] + 'px',
'z-index' : this.options.zIndex + 2
});

this.Contenido.css({
'height': this.options.BoxStyles['height'] + 'px',
'border-left-color' : this.options.Skin[this.options.color].hexcolor,
'border-right-color': this.options.Skin[this.options.color].hexcolor
});

this.Nav.css({
'color' : this.options.Skin[this.options.color].captionColor
});

this.Descripcion.css({
'color' : this.options.Skin[this.options.color].captionColor
});



/**
 * AGREGAMOS LOS EVENTOS
 ************************/

this.CloseButton.bind('click', $.bind(this, function(){
this.close();
return false;
}));

this.Overlay.bind('click', $.bind(this, function(){
if (!this.options.modal) {
this.close();
}
}));


 $(document).bind('keydown', $.bind(this, function(obj, event){
if (this.options.displayed == 1) {
if (event.keyCode == 27){
this.close();
}

if (event.keyCode == 37){
if (this.prev) {
this.prev.trigger('click', event);
}
}

if (event.keyCode == 39){
if (this.next) {
this.next.trigger('click', event);
}
}
}
}));

$(window).bind('resize', $.bind(this, function(){
if(this.options.displayed == 1) {
this.replaceBox();
} else {
this.Overlay.css({'height': '0px', 'width': '0px'});
}
}));

$(window).bind('scroll', $.bind(this, function(){
if(this.options.displayed == 1) {
this.replaceBox();
}
}));

this.refresh();

},

hook: function(enlace) {
enlace = $(enlace);
enlace.blur();
this.show((enlace.attr("title") || enlace.attr("name") || ""), enlace.attr("href"), (enlace.attr('rel') || false));
},

close: function() {
this.display(0);
this.modal = 0;
},

refresh: function() {
var self = this;
this.anchors = [];

$("a, area").each(function() {
if ($(this).attr('rel') && new RegExp("^"+self.options.find).test($(this).attr('rel'))){
$(this).click(function(event) {
event.preventDefault();
event.stopImmediatePropagation();
self.hook(this);
});

if (!($(this).attr('id')==self.options.name+"Left" || $(this).attr('id')==self.options.name+"Right")) {
self.anchors.push(this);
}
}
});
},

display: function(option) {
if(this.options.displayed == 0 && option != 0 || option == 1) {

$('embed, object, select').css({ 'visibility' : 'hidden' });

if (this.options.displayed == 0) {
this.Wrapper.css({
'top' : (-this.options.BoxStyles['height']-280)+'px',
'height': (this.options.BoxStyles['height']-80)+'px',
'width' : this.options.BoxStyles['width']+'px'
}).hide();
}

this.options.displayed = 1;
this.Overlay.stop();
this.Overlay.fadeIn(this.options.showDuration, $.bind(this, function(){
this.Wrapper.show();
this.Overlay.css({
'opacity' : this.options.OverlayStyles['opacity']
});
}));

}
 //Cerrar el Lightbox
else
{

$('embed, object, select').css({ 'visibility' : 'visible' });

this.Wrapper.css({
'top' : (-this.options.BoxStyles['height']-280)+'px',
'height': (this.options.BoxStyles['height']-80)+'px',
'width' : this.options.BoxStyles['width']+'px'
}).hide();

this.options.displayed = 0;

this.Overlay.stop();
this.Overlay.fadeOut(this.options.closeDuration, $.bind(this, function(){
if (this.Image)
this.Image.remove();
this.Overlay.css({'height': 0, 'width': 0 });
}));
}			
},

replaceBox: function(data) {

data = $.extend({
'width': this.ajustarWidth,
'height' : this.ajustarHeight,
'resize' : 0
}, data || {});

if (this.MoveBox)
this.MoveBox.stop();

this.MoveBox = this.Wrapper.animate({
left: ( $(window).scrollLeft()+ (($(window).width()- data.width) / 2)),
top : ( $(window).scrollTop() + ($(window).height() - (data.height + ((this.MostrarNav)?80:48))) / 2 )
}, {
duration: this.options.moveDuration,
easing: this.options.moveEffect
});

if (data.resize) {

if (this.ResizeBox2)
this.ResizeBox2.stop();
this.ResizeBox2 = this.Contenido.animate({
height : data.height
}, {
duration: this.options.resizeDuration,
easing: this.options.resizeEffect
});

if (this.ResizeBox)
this.ResizeBox.stop();

this.ResizeBox = this.Contenedor.animate({
width : data.width
}, {
duration: this.options.resizeDuration,
easing: this.options.resizeEffect,
complete: $.bind(this, function(){
this.Wrapper.css({'width' : data.width});
this.ResizeBox.trigger('onComplete');
})
});
}

if (window.opera) { //Opera Bug :(
this.Overlay.css({'height': 0, 'width': 0 });
}

this.Overlay.css({
'height': $(document).height(),
'width' : $(window).width()
});
},

getInfo: function (image, id) {
image=$(image);
IEuta = $('<a id="'+this.options.name+id+'" title="'+image.attr('title')+'" rel="'+image.attr('rel')+'"><img class="bt'+id+'" src="'+this.options.imagesdir+'/'+this.options.color+'/SexyBt'+id+'.png'+'" /></a>');
IEuta.attr('href', image.attr('href')); //IE fix
return IEuta;
},

show: function(caption, url, rel) {
this.MostrarNav = false;
this.showLoading();

var baseURL = url.match(/(.+)?/)[1] || url;

var imageURL = /\.(jpe?g|png|gif|bmp)/gi;

if (this.ResizeBox) {
this.ResizeBox.unbind('onComplete'); //fix for jQuery
}

if (caption) {
this.MostrarNav = true;
}
// check for images
if ( baseURL.match(imageURL) ) {
/**
 * Cargar Imagen.
 *****************/
this.imgPreloader = new Image();
this.imgPreloader.onload = $.bind(this, function(){
this.imgPreloader.onload=function(){};

//Resizing large images
var x = $(window).width() - 100;
var y = $(window).height() - 100;

var imageWidth = this.imgPreloader.width;
var imageHeight = this.imgPreloader.height;

if (imageWidth > x)
{
imageHeight = imageHeight * (x / imageWidth);
imageWidth = x;
if (imageHeight > y)
{
imageWidth = imageWidth * (y / imageHeight);
imageHeight = y;
}
}
else if (imageHeight > y)
{
imageWidth = imageWidth * (y / imageHeight);
imageHeight = y;
if (imageWidth > x)
{
imageHeight = imageHeight * (x / imageWidth);
imageWidth = x;
}
}
//End Resizing

//Ajustar el tamaņo del lightbox
if (this.MostrarNav || caption){
this.ajustarHeight = (imageHeight-21);
}else{
this.ajustarHeight = (imageHeight-35);
};

this.ajustarWidth = (imageWidth+14);

this.replaceBox({
'width':this.ajustarWidth,
'height' :this.ajustarHeight,
'resize' : 1
});

//Mostrar la imagen, solo cuando la animacion de resizado se ha completado
this.ResizeBox.bind('onComplete', $.bind(this, function(){
this.showImage(this.imgPreloader.src, {'width':imageWidth, 'height': imageHeight});
}));
});

this.imgPreloader.onerror = $.bind(this, function(){
this.show('', this.options.imagesdir+'/'+this.options.color+'/404.png', this.options.find);
});

this.imgPreloader.src = url;

} else { //code to show html pages
var queryString = url.match(/\?(.+)/)[1];
var params = this.parseQuery( queryString );
params['width'] = parseInt(params['width']);
params['height']= parseInt(params['height']);
params['modal'] = params['modal'];

this.options.modal = params['modal'];

this.ajustarHeight = parseInt(params['height'])+(window.opera?2:0);
this.ajustarWidth= parseInt(params['width'])+14;

this.replaceBox({
'width': this.ajustarWidth,
'height' : this.ajustarHeight,
'resize' : 1
});


if (url.indexOf('TB_inline') != -1) //INLINE ID
{
this.ResizeBox.bind('onComplete', $.bind(this, function(){
this.showContent($('#'+params['inlineId']).html(), {'width': params['width']+14, 'height': this.ajustarHeight}, params['background']);
}));
}
else if(url.indexOf('TB_iframe') != -1) //IFRAME
{
var urlNoQuery = url.split('TB_');
this.ResizeBox.bind('onComplete', $.bind(this, function(){
this.showIframe(urlNoQuery[0], {'width': params['width']+14, 'height': params['height']}, params['background']);
}));
}
else //AJAX
{
this.ResizeBox.bind('onComplete', $.bind(this, function(){
$.ajax({
url: url,
type: "GET",
cache: false,
error: $.bind(this, function(){this.show('', this.options.imagesdir+'/'+this.options.color+'/404html.png', this.options.find)}),
success: $.bind(this, this.handlerFunc)
});
}));
}

}


this.next = false;
this.prev = false;
 //Si la imagen pertenece a un grupo
if (rel.length > this.options.find.length)
{
this.MostrarNav = true;
var foundSelf = false;
var exit= false;
var self= this;

$.each(this.anchors, function(index){
if ($(this).attr('rel') == rel && !exit) {
if ($(this).attr('href') == url) {
foundSelf = true;
} else {
if (foundSelf) {
self.next = self.getInfo(this, "Right");
 //stop searching
exit = true;
} else {
self.prev = self.getInfo(this, "Left");
}
}
}
});
}

this.addButtons();
this.showNav(caption);
this.display(1);
},// end function

handlerFunc: function(obj, html) {
this.showContent(html, {'width':this.ajustarWidth, 'height': this.ajustarHeight});
},

showLoading: function() {
this.Background.empty().removeAttr('style').css({'width':'auto', 'height':'auto'});
this.Contenido.empty().css({
'background-color': 'transparent',
'padding' : '0px',
'width' : 'auto'
});

this.Contenedor.css({
'background' : 'url('+this.options.imagesdir+'/'+this.options.color+'/loading.gif) no-repeat 50% 50%'
});

this.Contenido.empty().css({
'background-color': 'transparent',
'padding' : '0px',
'width' : 'auto'
});

this.replaceBox({
'width': this.options.BoxStyles.width,
'height' : this.options.BoxStyles.height,
'resize' : 1
});

},

addButtons: function(){
if(this.prev) this.prev.bind('click', $.bind(this, function(obj, event) {event.preventDefault();this.hook(this.prev);}));
if(this.next) this.next.bind('click', $.bind(this, function(obj, event) {event.preventDefault();this.hook(this.next);}));
},

 /**
* Mostrar navegacion.
*****************/
showNav: function(caption) {
if (this.MostrarNav || caption) {
this.bb.addClass("SLB-bbnav");
this.Nav.empty();
this.innerbb.empty();
this.innerbb.append(this.Nav);
this.Descripcion.html(caption);
this.Nav.append(this.prev);
this.Nav.append(this.next);
this.Nav.append(this.Descripcion);
}
else
{
this.bb.removeClass("SLB-bbnav");
this.innerbb.empty();
}
},

showImage: function(image, size) {
this.Background.empty().removeAttr('style').css({'width':'auto', 'height':'auto'}).append('<img id="'+this.options.name+'-Image"/>');
this.Image = $('#'+this.options.name+'-Image');
this.Image.attr('src', image).css({
'width': size['width'],
'height' : size['height']
});

this.Contenedor.css({
'background' : 'none'
});

this.Contenido.empty().css({
'background-color': 'transparent',
'padding' : '0px',
'width' : 'auto'
});
},

showContent: function(html, size, bg) {
this.Background.empty().css({
'width': size['width']-14,
'height' : size['height']+35,
'background-color' : bg || '#ffffff'
});

this.Contenido.empty().css({
'width' : size['width']-14,
'background-color': bg || '#ffffff'
}).append('<div id="'+this.options.name+'-Image"/>');

this.Image = $('#'+this.options.name+'-Image');
this.Image.css({
'width' : size['width']-14,
'height': size['height'],
'overflow': 'auto',
'background': bg || '#ffffff'
}).append(html);

this.Contenedor.css({
'background': 'none'
});
var wId = $(this.Wrapper).attr('id');
$('#'+wId+' select, #'+wId+' object, #'+wId+' embed').css({ 'visibility' : 'visible' });
},

showIframe: function(src, size, bg) {
this.Background.empty().css({
'width' : size['width']-14,
'height': size['height']+35,
'background-color': bg || '#ffffff'
});

var id = "if_"+new Date().getTime()+"-Image";

this.Contenido.empty().css({
'width' : size['width']-14,
'background-color': bg || '#ffffff',
'padding' : '0px'
}).append('<iframe id="'+id+'" frameborder="0"></iframe>');

this.Image = $('#'+id);
this.Image.css({
'width' : size['width']-14,
'height': size['height'],
'background': bg || '#ffffff'
}).attr('src', src);

this.Contenedor.css({
'background' : 'none'
});
},

parseQuery: function (query) {
if( !query )
return {};
var params = {};

var pairs = query.split(/[;&]/);
for ( var i = 0; i < pairs.length; i++ ) {
var pair = pairs[i].split('=');
if ( !pair || pair.length != 2 )
continue;
params[unescape(pair[0])] = unescape(pair[1]).replace(/\+/g, ' ');
 }
 return params;
},

shake: function() {
var d=this.options.shake.distance;
var l=this.Wrapper.position();
l=l.left;
for(x=0;x<this.options.shake.loops;x++) {
 this.Wrapper.animate({left: l+d}, this.options.shake.duration, this.options.shake.transition)
 .animate({left: l-d}, this.options.shake.duration, this.options.shake.transition);
}
 this.Wrapper.animate({"left": l+d}, this.options.shake.duration, this.options.shake.transition)
 .animate({"left": l}, this.options.shake.duration, this.options.shake.transition);
}

}
})(jQuery);
/*
 * jQuery Easing v1.3 
 */
jQuery.easing['jswing'] = jQuery.easing['swing'];

jQuery.extend( jQuery.easing,
{
	def: 'easeOutQuad',
	swing: function (x, t, b, c, d) {
		//alert(jQuery.easing.default);
		return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
	},
	easeInQuad: function (x, t, b, c, d) {
		return c*(t/=d)*t + b;
	},
	easeOutQuad: function (x, t, b, c, d) {
		return -c *(t/=d)*(t-2) + b;
	},
	easeInOutQuad: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t + b;
		return -c/2 * ((--t)*(t-2) - 1) + b;
	},
	easeInCubic: function (x, t, b, c, d) {
		return c*(t/=d)*t*t + b;
	},
	easeOutCubic: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t + 1) + b;
	},
	easeInOutCubic: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t + b;
		return c/2*((t-=2)*t*t + 2) + b;
	},
	easeInQuart: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t + b;
	},
	easeOutQuart: function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	},
	easeInOutQuart: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
		return -c/2 * ((t-=2)*t*t*t - 2) + b;
	},
	easeInQuint: function (x, t, b, c, d) {
		return c*(t/=d)*t*t*t*t + b;
	},
	easeOutQuint: function (x, t, b, c, d) {
		return c*((t=t/d-1)*t*t*t*t + 1) + b;
	},
	easeInOutQuint: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
		return c/2*((t-=2)*t*t*t*t + 2) + b;
	},
	easeInSine: function (x, t, b, c, d) {
		return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
	},
	easeOutSine: function (x, t, b, c, d) {
		return c * Math.sin(t/d * (Math.PI/2)) + b;
	},
	easeInOutSine: function (x, t, b, c, d) {
		return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
	},
	easeInExpo: function (x, t, b, c, d) {
		return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
	},
	easeOutExpo: function (x, t, b, c, d) {
		return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
	},
	easeInOutExpo: function (x, t, b, c, d) {
		if (t==0) return b;
		if (t==d) return b+c;
		if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
		return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
	},
	easeInCirc: function (x, t, b, c, d) {
		return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
	},
	easeOutCirc: function (x, t, b, c, d) {
		return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
	},
	easeInOutCirc: function (x, t, b, c, d) {
		if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
		return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
	},
	easeInElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;if ((t/=d)==1) return b+c;if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
	},
	easeOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;if ((t/=d)==1) return b+c;if (!p) p=d*.3;
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
	},
	easeInOutElastic: function (x, t, b, c, d) {
		var s=1.70158;var p=0;var a=c;
		if (t==0) return b;if ((t/=d/2)==2) return b+c;if (!p) p=d*(.3*1.5);
		if (a < Math.abs(c)) { a=c; var s=p/4; }
		else var s = p/(2*Math.PI) * Math.asin (c/a);
		if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
		return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
	},
	easeInBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*(t/=d)*t*((s+1)*t - s) + b;
	},
	easeOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158;
		return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
	},
	easeInOutBack: function (x, t, b, c, d, s) {
		if (s == undefined) s = 1.70158; 
		if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
		return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
	},
	easeInBounce: function (x, t, b, c, d) {
		return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
	},
	easeOutBounce: function (x, t, b, c, d) {
		if ((t/=d) < (1/2.75)) {
			return c*(7.5625*t*t) + b;
		} else if (t < (2/2.75)) {
			return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
		} else if (t < (2.5/2.75)) {
			return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
		} else {
			return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
		}
	},
	easeInOutBounce: function (x, t, b, c, d) {
		if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
		return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
	}
});

