/***************************** GALLERIA ****************************/

(function(e){var s=this,t=s.document,I=e(t),E=false,x=navigator.userAgent.toLowerCase(),J=s.location.hash.replace(/#\//,""),y=function(){return j.TOUCH?"touchstart":"click"},u=function(){var a=3,b=t.createElement("div"),c=b.getElementsByTagName("i");do b.innerHTML="<!--[if gt IE "+ ++a+"]><i></i><![endif]--\>";while(c[0]);return a>4?a:void 0}(),z=function(){return{html:t.documentElement,body:t.body,head:t.getElementsByTagName("head")[0],title:t.title}},K=function(){var a=[];e.each("data ready thumbnail loadstart loadfinish image play pause progress fullscreen_enter fullscreen_exit idle_enter idle_exit rescale lightbox_open lightbox_close lightbox_image".split(" "),
function(b,c){a.push(c);/_/.test(c)&&a.push(c.replace(/_/g,""))});return a}(),L=function(a){var b;if(typeof a!=="object")return a;e.each(a,function(c,d){if(/^[a-z]+_/.test(c)){b="";e.each(c.split("_"),function(i,k){b+=i>0?k.substr(0,1).toUpperCase()+k.substr(1):k});a[b]=d;delete a[c]}});return a},F=function(a){if(e.inArray(a,K)>-1)return j[a.toUpperCase()];return a},B={trunk:{},add:function(a,b,c,d){d=d||false;this.clear(a);if(d){var i=b;b=function(){i();B.add(a,b,c)}}this.trunk[a]=s.setTimeout(b,
c)},clear:function(a){var b=function(d){s.clearTimeout(this.trunk[d]);delete this.trunk[d]},c;if(a&&a in this.trunk)b.call(B,a);else if(typeof a==="undefined")for(c in this.trunk)this.trunk.hasOwnProperty(c)&&b.call(B,c)}},C=[],g=function(){return{array:function(a){return Array.prototype.slice.call(a)},create:function(a,b){b=b||"div";var c=t.createElement(b);c.className=a;return c},forceStyles:function(a,b){a=e(a);a.attr("style")&&a.data("styles",a.attr("style")).removeAttr("style");a.css(b)},revertStyles:function(){e.each(g.array(arguments),
function(a,b){b=e(b).removeAttr("style");b.data("styles")&&b.attr("style",b.data("styles")).data("styles",null)})},moveOut:function(a){g.forceStyles(a,{position:"absolute",left:-1E4})},moveIn:function(){g.revertStyles.apply(g,g.array(arguments))},hide:function(a,b,c){a=e(a);a.data("opacity")||a.data("opacity",a.css("opacity"));var d={opacity:0};b?a.stop().animate(d,b,c):a.css(d)},show:function(a,b,c){a=e(a);var d=parseFloat(a.data("opacity"))||1,i={opacity:d};d===1&&a.data("opacity",null);b?a.stop().animate(i,
b,c):a.css(i)},addTimer:function(){B.add.apply(B,g.array(arguments));return this},clearTimer:function(){B.clear.apply(B,g.array(arguments));return this},wait:function(a){a=e.extend({until:function(){return false},success:function(){},error:function(){j.raise("Could not complete wait function.")},timeout:3E3},a);var b=g.timestamp(),c,d,i=function(){d=g.timestamp();c=d-b;if(a.until(c)){a.success();return false}if(d>=b+a.timeout){a.error();return false}s.setTimeout(i,2)};s.setTimeout(i,2)},toggleQuality:function(a,
b){if(!(u!==7&&u!==8||!a)){if(typeof b==="undefined")b=a.style.msInterpolationMode==="nearest-neighbor";a.style.msInterpolationMode=b?"bicubic":"nearest-neighbor"}},insertStyleTag:function(a){var b=t.createElement("style");z().head.appendChild(b);if(b.styleSheet)b.styleSheet.cssText=a;else{a=t.createTextNode(a);b.appendChild(a)}},loadScript:function(a,b){var c=false,d=e("<script>").attr({src:a,async:true}).get(0);d.onload=d.onreadystatechange=function(){if(!c&&(!this.readyState||this.readyState===
"loaded"||this.readyState==="complete")){c=true;d.onload=d.onreadystatechange=null;typeof b==="function"&&b.call(this,this)}};z().head.appendChild(d)},parseValue:function(a){if(typeof a==="number")return a;else if(typeof a==="string")return(a=a.match(/\-?\d/g))&&a.constructor===Array?parseInt(a.join(""),10):0;else return 0},timestamp:function(){return(new Date).getTime()},loadCSS:function(a,b,c){var d,i=false,k;e("link[rel=stylesheet]").each(function(){if(RegExp(a).test(this.href)){d=this;return false}});
if(typeof b==="function"){c=b;b=void 0}c=c||function(){};if(d){c.call(d,d);return d}k=t.styleSheets.length;if(E)a+="?"+g.timestamp();if(e("#"+b).length){e("#"+b).attr("href",a);k--;i=true}else{d=e("<link>").attr({rel:"stylesheet",href:a,id:b}).get(0);s.setTimeout(function(){var l=e('link[rel="stylesheet"], style');l.length?l.get(0).parentNode.insertBefore(d,l[0]):z().head.appendChild(d);if(u)d.attachEvent("onreadystatechange",function(){if(d.readyState==="complete")i=true});else i=true},10)}typeof c===
"function"&&g.wait({until:function(){return i&&t.styleSheets.length>k},success:function(){g.addTimer("css",function(){c.call(d,d)},100)},error:function(){j.raise("Theme CSS could not load")},timeout:1E3});return d}}}(),G={fade:function(a,b){e(a.next).css("opacity",0).show().animate({opacity:1},a.speed,b);a.prev&&e(a.prev).css("opacity",1).show().animate({opacity:0},a.speed)},flash:function(a,b){e(a.next).css("opacity",0);a.prev?e(a.prev).animate({opacity:0},a.speed/2,function(){e(a.next).animate({opacity:1},
a.speed,b)}):e(a.next).animate({opacity:1},a.speed,b)},pulse:function(a,b){a.prev&&e(a.prev).hide();e(a.next).css("opacity",0).animate({opacity:1},a.speed,b)},slide:function(a,b){var c=e(a.next).parent(),d=this.$("images"),i=this._stageWidth,k=this.getOptions("easing");c.css({left:i*(a.rewind?-1:1)});d.animate({left:i*(a.rewind?1:-1)},{duration:a.speed,queue:false,easing:k,complete:function(){d.css("left",0);c.css("left",0);b()}})},fadeslide:function(a,b){var c=0,d=this.getOptions("easing"),i=this.getStageWidth();
if(a.prev){c=g.parseValue(e(a.prev).css("left"));e(a.prev).css({opacity:1,left:c}).animate({opacity:0,left:c+i*(a.rewind?1:-1)},{duration:a.speed,queue:false,easing:d})}c=g.parseValue(e(a.next).css("left"));e(a.next).css({left:c+i*(a.rewind?-1:1),opacity:0}).animate({opacity:1,left:c},{duration:a.speed,complete:b,queue:false,easing:d})}},j=function(){var a=this;this._theme=void 0;this._options={};this._playing=false;this._playtime=5E3;this._active=null;this._queue={length:0};this._data=[];this._dom=
{};this._thumbnails=[];this._initialized=false;this._stageHeight=this._stageWidth=0;this._target=void 0;this._id=Math.random();e.each("container stage images image-nav image-nav-left image-nav-right info info-text info-title info-description info-author thumbnails thumbnails-list thumbnails-container thumb-nav-left thumb-nav-right loader counter tooltip".split(" "),function(f,h){a._dom[h]=g.create("galleria-"+h)});e.each("current total".split(" "),function(f,h){a._dom[h]=g.create("galleria-"+h,"span")});
var b=this._keyboard={keys:{UP:38,DOWN:40,LEFT:37,RIGHT:39,RETURN:13,ESCAPE:27,BACKSPACE:8,SPACE:32},map:{},bound:false,press:function(f){var h=f.keyCode||f.which;h in b.map&&typeof b.map[h]==="function"&&b.map[h].call(a,f)},attach:function(f){var h,n;for(h in f)if(f.hasOwnProperty(h)){n=h.toUpperCase();if(n in b.keys)b.map[b.keys[n]]=f[h]}if(!b.bound){b.bound=true;I.bind("keydown",b.press)}},detach:function(){b.bound=false;I.unbind("keydown",b.press)}},c=this._controls={0:void 0,1:void 0,active:0,
swap:function(){c.active=c.active?0:1},getActive:function(){return c[c.active]},getNext:function(){return c[1-c.active]}},d=this._carousel={next:a.$("thumb-nav-right"),prev:a.$("thumb-nav-left"),width:0,current:0,max:0,hooks:[],update:function(){var f=0,h=0,n=[0];e.each(a._thumbnails,function(o,p){if(p.ready){f+=p.outerWidth||e(p.container).outerWidth(true);n[o+1]=f;h=Math.max(h,p.outerHeight||e(p.container).outerHeight(true))}});a.$("thumbnails").css({width:f,height:h});d.max=f;d.hooks=n;d.width=
a.$("thumbnails-list").width();d.setClasses();a.$("thumbnails-container").toggleClass("galleria-carousel",f>d.width)},bindControls:function(){var f;d.next.bind(y(),function(h){h.preventDefault();if(a._options.carouselSteps==="auto")for(f=d.current;f<d.hooks.length;f++){if(d.hooks[f]-d.hooks[d.current]>d.width){d.set(f-2);break}}else d.set(d.current+a._options.carouselSteps)});d.prev.bind(y(),function(h){h.preventDefault();if(a._options.carouselSteps==="auto")for(f=d.current;f>=0;f--)if(d.hooks[d.current]-
d.hooks[f]>d.width){d.set(f+2);break}else{if(f===0){d.set(0);break}}else d.set(d.current-a._options.carouselSteps)})},set:function(f){for(f=Math.max(f,0);d.hooks[f-1]+d.width>=d.max&&f>=0;)f--;d.current=f;d.animate()},getLast:function(f){return(f||d.current)-1},follow:function(f){if(f===0||f===d.hooks.length-2)d.set(f);else{for(var h=d.current;d.hooks[h]-d.hooks[d.current]<d.width&&h<=d.hooks.length;)h++;if(f-1<d.current)d.set(f-1);else f+2>h&&d.set(f-h+d.current+2)}},setClasses:function(){d.prev.toggleClass("disabled",
!d.current);d.next.toggleClass("disabled",d.hooks[d.current]+d.width>=d.max)},animate:function(){d.setClasses();var f=d.hooks[d.current]*-1;isNaN(f)||a.$("thumbnails").animate({left:f},{duration:a._options.carouselSpeed,easing:a._options.easing,queue:false})}},i=this._tooltip={initialized:false,open:false,init:function(){i.initialized=true;g.insertStyleTag(".galleria-tooltip{padding:3px 8px;max-width:50%;background:#ffe;color:#000;z-index:3;position:absolute;font-size:11px;line-height:1.3opacity:0;box-shadow:0 0 2px rgba(0,0,0,.4);-moz-box-shadow:0 0 2px rgba(0,0,0,.4);-webkit-box-shadow:0 0 2px rgba(0,0,0,.4);}");
a.$("tooltip").css("opacity",0.8);g.hide(a.get("tooltip"))},move:function(f){var h=a.getMousePosition(f).x;f=a.getMousePosition(f).y;var n=a.$("tooltip");h=h;var o=f,p=n.outerHeight(true)+1,q=n.outerWidth(true),r=p+15;q=a.$("container").width()-q-2;p=a.$("container").height()-p-2;if(!isNaN(h)&&!isNaN(o)){h+=10;o-=30;h=Math.max(0,Math.min(q,h));o=Math.max(0,Math.min(p,o));if(f<r)o=r;n.css({left:h,top:o})}},bind:function(f,h){i.initialized||i.init();var n=function(o,p){i.define(o,p);e(o).hover(function(){g.clearTimer("switch_tooltip");
a.$("container").unbind("mousemove",i.move).bind("mousemove",i.move).trigger("mousemove");i.show(o);j.utils.addTimer("tooltip",function(){a.$("tooltip").stop().show();g.show(a.get("tooltip"),400);i.open=true},i.open?0:500)},function(){a.$("container").unbind("mousemove",i.move);g.clearTimer("tooltip");a.$("tooltip").stop();g.hide(a.get("tooltip"),200,function(){a.$("tooltip").hide();g.addTimer("switch_tooltip",function(){i.open=false},1E3)})})};typeof h==="string"?n(f in a._dom?a.get(f):f,h):e.each(f,
function(o,p){n(a.get(o),p)})},show:function(f){f=e(f in a._dom?a.get(f):f);var h=f.data("tt"),n=function(o){s.setTimeout(function(p){return function(){i.move(p)}}(o),10);f.unbind("mouseup",n)};if(h=typeof h==="function"?h():h){a.$("tooltip").html(h.replace(/\s/,"&nbsp;"));f.bind("mouseup",n)}},define:function(f,h){if(typeof h!=="function"){var n=h;h=function(){return n}}f=e(f in a._dom?a.get(f):f).data("tt",h);i.show(f)}},k=this._fullscreen={scrolled:0,active:false,enter:function(f){k.active=true;
g.hide(a.getActiveImage());a.$("container").addClass("fullscreen");k.scrolled=e(s).scrollTop();g.forceStyles(a.get("container"),{position:"fixed",top:0,left:0,width:"100%",height:"100%",zIndex:1E4});var h={height:"100%",overflow:"hidden",margin:0,padding:0};g.forceStyles(z().html,h);g.forceStyles(z().body,h);a.attachKeyboard({escape:a.exitFullscreen,right:a.next,left:a.prev});a.rescale(function(){g.addTimer("fullscreen_enter",function(){g.show(a.getActiveImage());typeof f==="function"&&f.call(a)},
100);a.trigger(j.FULLSCREEN_ENTER)});e(s).resize(function(){k.scale()})},scale:function(){a.rescale()},exit:function(f){k.active=false;g.hide(a.getActiveImage());a.$("container").removeClass("fullscreen");g.revertStyles(a.get("container"),z().html,z().body);s.scrollTo(0,k.scrolled);a.detachKeyboard();a.rescale(function(){g.addTimer("fullscreen_exit",function(){g.show(a.getActiveImage());typeof f==="function"&&f.call(a)},50);a.trigger(j.FULLSCREEN_EXIT)});e(s).unbind("resize",k.scale)}},l=this._idle=
{trunk:[],bound:false,add:function(f,h){if(f){l.bound||l.addEvent();f=e(f);var n={},o;for(o in h)if(h.hasOwnProperty(o))n[o]=f.css(o);f.data("idle",{from:n,to:h,complete:true,busy:false});l.addTimer();l.trunk.push(f)}},remove:function(f){f=jQuery(f);e.each(l.trunk,function(h,n){if(n.length&&!n.not(f).length){a._idle.show(f);a._idle.trunk.splice(h,1)}});if(!l.trunk.length){l.removeEvent();g.clearTimer("idle")}},addEvent:function(){l.bound=true;a.$("container").bind("mousemove click",l.showAll)},removeEvent:function(){l.bound=
false;a.$("container").unbind("mousemove click",l.showAll)},addTimer:function(){g.addTimer("idle",function(){a._idle.hide()},a._options.idleTime)},hide:function(){a.trigger(j.IDLE_ENTER);e.each(l.trunk,function(f,h){var n=h.data("idle");if(n){h.data("idle").complete=false;h.stop().animate(n.to,{duration:a._options.idleSpeed,queue:false,easing:"swing"})}})},showAll:function(){g.clearTimer("idle");e.each(a._idle.trunk,function(f,h){a._idle.show(h)})},show:function(f){var h=f.data("idle");if(!h.busy&&
!h.complete){h.busy=true;a.trigger(j.IDLE_EXIT);g.clearTimer("idle");f.stop().animate(h.from,{duration:a._options.idleSpeed/2,queue:false,easing:"swing",complete:function(){e(this).data("idle").busy=false;e(this).data("idle").complete=true}})}l.addTimer()}},m=this._lightbox={width:0,height:0,initialized:false,active:null,image:null,elems:{},init:function(){a.trigger(j.LIGHTBOX_OPEN);if(!m.initialized){m.initialized=true;var f={},h=a._options,n="";h={overlay:"position:fixed;display:none;opacity:"+
h.overlayOpacity+";filter:alpha(opacity="+h.overlayOpacity*100+");top:0;left:0;width:100%;height:100%;background:"+h.overlayBackground+";z-index:99990",box:"position:fixed;display:none;width:400px;height:400px;top:50%;left:50%;margin-top:-200px;margin-left:-200px;z-index:99991",shadow:"position:absolute;background:#000;width:100%;height:100%;",content:"position:absolute;background-color:#fff;top:10px;left:10px;right:10px;bottom:10px;overflow:hidden",info:"position:absolute;bottom:10px;left:10px;right:10px;color:#444;font:11px/13px arial,sans-serif;height:13px",
close:"position:absolute;top:10px;right:10px;height:20px;width:20px;background:#fff;text-align:center;cursor:pointer;color:#444;font:16px/22px arial,sans-serif;z-index:99999",image:"position:absolute;top:10px;left:10px;right:10px;bottom:30px;overflow:hidden;display:block;",prevholder:"position:absolute;width:50%;top:0;bottom:40px;cursor:pointer;",nextholder:"position:absolute;width:50%;top:0;bottom:40px;right:-1px;cursor:pointer;",prev:"position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;left:20px;display:none;line-height:40px;text-align:center;color:#000",
next:"position:absolute;top:50%;margin-top:-20px;height:40px;width:30px;background:#fff;right:20px;left:auto;display:none;line-height:40px;text-align:center;color:#000",title:"float:left",counter:"float:right;margin-left:8px;"};var o={};if(u===8){h.nextholder+="background:#000;filter:alpha(opacity=0);";h.prevholder+="background:#000;filter:alpha(opacity=0);"}e.each(h,function(p,q){n+=".galleria-lightbox-"+p+"{"+q+"}"});g.insertStyleTag(n);e.each("overlay box content shadow title info close prevholder prev nextholder next counter image".split(" "),
function(p,q){a.addElement("lightbox-"+q);f[q]=m.elems[q]=a.get("lightbox-"+q)});m.image=new j.Picture;e.each({box:"shadow content close prevholder nextholder",info:"title counter",content:"info image",prevholder:"prev",nextholder:"next"},function(p,q){var r=[];e.each(q.split(" "),function(w,v){r.push("lightbox-"+v)});o["lightbox-"+p]=r});a.append(o);e(f.image).append(m.image.container);e(z().body).append(f.overlay,f.box);(function(p){return p.hover(function(){e(this).css("color","#bbb")},function(){e(this).css("color",
"#444")})})(e(f.close).bind(y(),m.hide).html("&#215;"));e.each(["Prev","Next"],function(p,q){var r=e(f[q.toLowerCase()]).html(/v/.test(q)?"&#8249;&nbsp;":"&nbsp;&#8250;"),w=e(f[q.toLowerCase()+"holder"]);w.bind(y(),function(){m["show"+q]()});u<8?r.show():w.hover(function(){r.show()},function(){r.stop().fadeOut(200)})});e(f.overlay).bind(y(),m.hide)}},rescale:function(f){var h=Math.min(e(s).width()-40,m.width),n=Math.min(e(s).height()-60,m.height);n=Math.min(h/m.width,n/m.height);h=m.width*n+40;n=
m.height*n+60;h={width:h,height:n,marginTop:Math.ceil(n/2)*-1,marginLeft:Math.ceil(h/2)*-1};f?e(m.elems.box).css(h):e(m.elems.box).animate(h,a._options.lightboxTransitionSpeed,a._options.easing,function(){var o=m.image,p=a._options.lightboxFadeSpeed;a.trigger({type:j.LIGHTBOX_IMAGE,imageTarget:o.image});o.show();g.show(o.image,p);g.show(m.elems.info,p)})},hide:function(){m.image.image=null;e(s).unbind("resize",m.rescale);e(m.elems.box).hide();g.hide(m.elems.info);g.hide(m.elems.overlay,200,function(){e(this).hide().css("opacity",
a._options.overlayOpacity);a.trigger(j.LIGHTBOX_CLOSE)})},showNext:function(){m.show(a.getNext(m.active))},showPrev:function(){m.show(a.getPrev(m.active))},show:function(f){m.active=f=typeof f==="number"?f:a.getIndex();m.initialized||m.init();e(s).unbind("resize",m.rescale);var h=a.getData(f),n=a.getDataLength();g.hide(m.elems.info);m.image.load(h.image,function(o){m.width=o.original.width;m.height=o.original.height;e(o.image).css({width:"100.5%",height:"100.5%",top:0,zIndex:99998,opacity:0});m.elems.title.innerHTML=
h.title;m.elems.counter.innerHTML=f+1+" / "+n;e(s).resize(m.rescale);m.rescale()});e(m.elems.overlay).show();e(m.elems.box).show()}};return this};j.prototype={constructor:j,init:function(a,b){var c=this;b=L(b);C.push(this);this._original={target:a,options:b,data:null};if(this._target=this._dom.target=a.nodeName?a:e(a).get(0)){this._options={autoplay:false,carousel:true,carouselFollow:true,carouselSpeed:400,carouselSteps:"auto",clicknext:false,dataConfig:function(){return{}},dataSelector:"img",dataSource:this._target,
debug:void 0,easing:"galleria",extend:function(){},height:"auto",idleTime:3E3,idleSpeed:200,imageCrop:false,imageMargin:0,imagePan:false,imagePanSmoothness:12,imagePosition:"50%",keepSource:false,lightboxFadeSpeed:200,lightboxTransition_speed:500,linkSourceTmages:true,maxScaleRatio:void 0,minScaleRatio:void 0,overlayOpacity:0.85,overlayBackground:"#0b0b0b",pauseOnInteraction:true,popupLinks:false,preload:2,queue:true,show:0,showInfo:true,showCounter:true,showImagenav:true,thumbCrop:true,thumbEventType:y(),
thumbFit:true,thumbMargin:0,thumbQuality:"auto",thumbnails:true,transition:"fade",transitionInitial:void 0,transitionSpeed:400,width:"auto"};if(b&&b.debug===true)E=true;e(this._target).children().hide();typeof j.theme==="object"?this._init():g.wait({until:function(){return typeof j.theme==="object"},success:function(){c._init.call(c)},error:function(){j.raise("No theme found.",true)},timeout:5E3})}else j.raise("Target not found.")},_init:function(){var a=this;if(this._initialized){j.raise("Init failed: Gallery instance already initialized.");
return this}this._initialized=true;if(!j.theme){j.raise("Init failed: No theme found.");return this}e.extend(true,this._options,j.theme.defaults,this._original.options);this.bind(j.DATA,function(){this._original.data=this._data;this.get("total").innerHTML=this.getDataLength();var b=this.$("container"),c={width:0,height:0},d=g.create("galleria-image");g.wait({until:function(){e.each(["width","height"],function(k,l){c[l]=a._options[l]&&typeof a._options[l]==="number"?a._options[l]:Math.max(g.parseValue(b.css(l)),
g.parseValue(a.$("target").css(l)),b[l](),a.$("target")[l]())});var i=function(){return true};if(a._options.thumbnails){a.$("thumbnails").append(d);i=function(){return!!e(d).height()}}return i()&&c.width&&c.height>10},success:function(){e(d).remove();b.width(c.width);b.height(c.height);j.WEBKIT?s.setTimeout(function(){a._run()},1):a._run()},error:function(){j.raise("Width & Height not found.",true)},timeout:2E3})});this.bind(j.READY,function(b){return function(){g.show(this.get("counter"));this._options.carousel&&
this._carousel.bindControls();if(this._options.autoplay){this.pause();if(typeof this._options.autoplay==="number")this._playtime=this._options.autoplay;this.trigger(j.PLAY);this._playing=true}if(b)typeof this._options.show==="number"&&this.show(this._options.show);else{b=true;if(this._options.clicknext){e.each(this._data,function(c,d){delete d.link});this.$("stage").css({cursor:"pointer"}).bind(y(),function(){a.next()})}j.History&&j.History.change(function(c){c=parseInt(c.value.replace(/\//,""),10);
isNaN(c)?s.history.go(-1):a.show(c,void 0,true)});j.theme.init.call(this,this._options);this._options.extend.call(this,this._options);/^[0-9]{1,4}$/.test(J)&&j.History?this.show(J,void 0,true):this.show(this._options.show)}}}(false));this.append({"info-text":["info-title","info-description","info-author"],info:["info-text"],"image-nav":["image-nav-right","image-nav-left"],stage:["images","loader","counter","image-nav"],"thumbnails-list":["thumbnails"],"thumbnails-container":["thumb-nav-left","thumbnails-list",
"thumb-nav-right"],container:["stage","thumbnails-container","info","tooltip"]});g.hide(this.$("counter").append(this.get("current")," / ",this.get("total")));this.setCounter("&#8211;");g.hide(a.get("tooltip"));e.each(Array(2),function(b){var c=new j.Picture;e(c.container).css({position:"absolute",top:0,left:0});a.$("images").append(c.container);a._controls[b]=c});this.$("images").css({position:"relative",top:0,left:0,width:"100%",height:"100%"});this.$("thumbnails, thumbnails-list").css({overflow:"hidden",
position:"relative"});this.$("image-nav-right, image-nav-left").bind(y(),function(b){a._options.clicknext&&b.stopPropagation();a._options.pause_on_interaction&&a.pause();b=/right/.test(this.className)?"next":"prev";a[b]()});e.each(["info","counter","image-nav"],function(b,c){a._options["show"+c.substr(0,1).toUpperCase()+c.substr(1).replace(/-/,"")]===false&&g.moveOut(a.get(c.toLowerCase()))});this.load();if(!this._options.keep_source&&!u)this._target.innerHTML="";this.$("target").append(this.get("container"));
this._options.carousel&&this.bind(j.THUMBNAIL,function(){this.updateCarousel()});return this},_createThumbnails:function(){var a,b,c,d,i,k=this,l=this._options,m=function(){var q=k.$("thumbnails").find(".active");if(!q.length)return false;return q.find("img").attr("src")}(),f=typeof l.thumbnails==="string"?l.thumbnails.toLowerCase():null,h=function(q){return t.defaultView&&t.defaultView.getComputedStyle?t.defaultView.getComputedStyle(c.container,null)[q]:i.css(q)},n=function(q,r,w){return function(){e(w).append(q);
k.trigger({type:j.THUMBNAIL,thumbTarget:q,index:r})}},o=function(q){l.pauseOnInteraction&&k.pause();var r=e(q.currentTarget).data("index");k.getIndex()!==r&&k.show(r);q.preventDefault()},p=function(q){q.scale({width:q.data.width,height:q.data.height,crop:l.thumbCrop,margin:l.thumbMargin,complete:function(r){var w=["left","top"],v,A;e.each(["Width","Height"],function(D,H){v=H.toLowerCase();if((l.thumbCrop!==true||l.thumbCrop===v)&&l.thumbFit){A={};A[v]=r[v];e(r.container).css(A);A={};A[w[D]]=0;e(r.image).css(A)}r["outer"+
H]=e(r.container)["outer"+H](true)});g.toggleQuality(r.image,l.thumbQuality===true||l.thumbQuality==="auto"&&r.original.width<r.width*3);k.trigger({type:j.THUMBNAIL,thumbTarget:r.image,index:r.data.order})}})};this._thumbnails=[];this.$("thumbnails").empty();for(a=0;this._data[a];a++){d=this._data[a];if(l.thumbnails===true){c=new j.Picture(a);b=d.thumb||d.image;this.$("thumbnails").append(c.container);i=e(c.container);c.data={width:g.parseValue(h("width")),height:g.parseValue(h("height")),order:a};
l.thumbFit&&l.thumbCrop!==true?i.css({width:0,height:0}):i.css({width:c.data.width,height:c.data.height});c.load(b,p);l.preload==="all"&&c.add(d.image)}else if(f==="empty"||f==="numbers"){c={container:g.create("galleria-image"),image:g.create("img","span"),ready:true};f==="numbers"&&e(c.image).text(a+1);this.$("thumbnails").append(c.container);s.setTimeout(n(c.image,a,c.container),50+a*20)}else c={container:null,image:null};e(c.container).add(l.keepSource&&l.linkSourceImages?d.original:null).data("index",
a).bind(l.thumbEventType,o);m===b&&e(c.container).addClass("active");this._thumbnails.push(c)}},_run:function(){var a=this;a._createThumbnails();g.wait({until:function(){j.OPERA&&a.$("stage").css("display","inline-block");a._stageWidth=a.$("stage").width();a._stageHeight=a.$("stage").height();return a._stageWidth&&a._stageHeight>50},success:function(){a.trigger(j.READY)},error:function(){j.raise("Stage measures not found",true)}})},load:function(a,b,c){var d=this;this._data=[];this._thumbnails=[];
this.$("thumbnails").empty();if(typeof b==="function"){c=b;b=null}a=a||this._options.dataSource;b=b||this._options.dataSelector;c=c||this._options.dataConfig;if(a.constructor===Array){if(this.validate(a)){this._data=a;this._parseData().trigger(j.DATA)}else j.raise("Load failed: JSON Array not valid.");return this}e(a).find(b).each(function(i,k){k=e(k);var l={},m=k.parent().attr("href");if(/\.(png|gif|jpg|jpeg)(\?.*)?$/i.test(m))l.image=m;else if(m)l.link=m;d._data.push(e.extend({title:k.attr("title"),
thumb:k.attr("src"),image:k.attr("src"),description:k.attr("alt"),link:k.attr("longdesc"),original:k.get(0)},l,c(k)))});this.getDataLength()?this.trigger(j.DATA):j.raise("Load failed: no data found.");return this},_parseData:function(){var a=this;e.each(this._data,function(b,c){if("thumb"in c===false)a._data[b].thumb=c.image});return this},splice:function(){Array.prototype.splice.apply(this._data,g.array(arguments));return this._parseData()._createThumbnails()},push:function(){Array.prototype.push.apply(this._data,
g.array(arguments));return this._parseData()._createThumbnails()},_getActive:function(){return this._controls.getActive()},validate:function(){return true},bind:function(a,b){a=F(a);this.$("container").bind(a,this.proxy(b));return this},unbind:function(a){a=F(a);this.$("container").unbind(a);return this},trigger:function(a){a=typeof a==="object"?e.extend(a,{scope:this}):{type:F(a),scope:this};this.$("container").trigger(a);return this},addIdleState:function(){this._idle.add.apply(this._idle,g.array(arguments));
return this},removeIdleState:function(){this._idle.remove.apply(this._idle,g.array(arguments));return this},enterIdleMode:function(){this._idle.hide();return this},exitIdleMode:function(){this._idle.showAll();return this},enterFullscreen:function(){this._fullscreen.enter.apply(this,g.array(arguments));return this},exitFullscreen:function(){this._fullscreen.exit.apply(this,g.array(arguments));return this},toggleFullscreen:function(){this._fullscreen[this.isFullscreen()?"exit":"enter"].apply(this,g.array(arguments));
return this},bindTooltip:function(){this._tooltip.bind.apply(this._tooltip,g.array(arguments));return this},defineTooltip:function(){this._tooltip.define.apply(this._tooltip,g.array(arguments));return this},refreshTooltip:function(){this._tooltip.show.apply(this._tooltip,g.array(arguments));return this},openLightbox:function(){this._lightbox.show.apply(this._lightbox,g.array(arguments));return this},closeLightbox:function(){this._lightbox.hide.apply(this._lightbox,g.array(arguments));return this},
getActiveImage:function(){return this._getActive().image||void 0},getActiveThumb:function(){return this._thumbnails[this._active].image||void 0},getMousePosition:function(a){return{x:a.pageX-this.$("container").offset().left,y:a.pageY-this.$("container").offset().top}},addPan:function(a){if(this._options.imageCrop!==false){a=e(a||this.getActiveImage());var b=this,c=a.width()/2,d=a.height()/2,i=parseInt(a.css("left"),10),k=parseInt(a.css("top"),10),l=i||0,m=k||0,f=0,h=0,n=false,o=g.timestamp(),p=0,
q=0,r=function(v,A,D){if(v>0){q=Math.round(Math.max(v*-1,Math.min(0,A)));if(p!==q){p=q;if(u===8)a.parent()["scroll"+D](q*-1);else{v={};v[D.toLowerCase()]=q;a.css(v)}}}},w=function(v){if(!(g.timestamp()-o<50)){n=true;c=b.getMousePosition(v).x;d=b.getMousePosition(v).y}};if(u===8){a.parent().scrollTop(m*-1).scrollLeft(l*-1);a.css({top:0,left:0})}this.$("stage").unbind("mousemove",w).bind("mousemove",w);g.addTimer("pan",function(){if(n){f=a.width()-b._stageWidth;h=a.height()-b._stageHeight;i=c/b._stageWidth*
f*-1;k=d/b._stageHeight*h*-1;l+=(i-l)/b._options.imagePanSmoothness;m+=(k-m)/b._options.imagePanSmoothness;r(h,m,"Top");r(f,l,"Left")}},50,true);return this}},proxy:function(a,b){if(typeof a!=="function")return function(){};b=b||this;return function(){return a.apply(b,g.array(arguments))}},removePan:function(){this.$("stage").unbind("mousemove");g.clearTimer("pan");return this},addElement:function(){var a=this._dom;e.each(g.array(arguments),function(b,c){a[c]=g.create("galleria-"+c)});return this},
attachKeyboard:function(){this._keyboard.attach.apply(this._keyboard,g.array(arguments));return this},detachKeyboard:function(){this._keyboard.detach.apply(this._keyboard,g.array(arguments));return this},appendChild:function(a,b){this.$(a).append(this.get(b)||b);return this},prependChild:function(a,b){this.$(a).prepend(this.get(b)||b);return this},remove:function(){this.$(g.array(arguments).join(",")).remove();return this},append:function(a){var b,c;for(b in a)if(a.hasOwnProperty(b))if(a[b].constructor===
Array)for(c=0;a[b][c];c++)this.appendChild(b,a[b][c]);else this.appendChild(b,a[b]);return this},_scaleImage:function(a,b){b=e.extend({width:this._stageWidth,height:this._stageHeight,crop:this._options.imageCrop,max:this._options.maxScaleRatio,min:this._options.minScaleRatio,margin:this._options.imageMargin,position:this._options.imagePosition},b);(a||this._controls.getActive()).scale(b);return this},updateCarousel:function(){this._carousel.update();return this},rescale:function(a,b,c){var d=this;
if(typeof a==="function"){c=a;a=void 0}var i=function(){d._stageWidth=a||d.$("stage").width();d._stageHeight=b||d.$("stage").height();d._scaleImage();d._options.carousel&&d.updateCarousel();d.trigger(j.RESCALE);typeof c==="function"&&c.call(d)};j.WEBKIT&&!a&&!b?g.addTimer("scale",i,5):i.call(d);return this},refreshImage:function(){this._scaleImage();this._options.imagePan&&this.addPan();return this},show:function(a,b,c){if(!(a===false||!this._options.queue&&this._queue.stalled)){a=Math.max(0,Math.min(parseInt(a,
10),this.getDataLength()-1));b=typeof b!=="undefined"?!!b:a<this.getIndex();c=c||false;if(!c&&j.History)j.History.value(a.toString());else{this._active=a;Array.prototype.push.call(this._queue,{index:a,rewind:b});this._queue.stalled||this._show();return this}}},_show:function(){var a=this,b=this._queue[0],c=this.getData(b.index);if(c){var d=c.image,i=this._controls.getActive(),k=this._controls.getNext(),l=k.isCached(d),m=this._thumbnails[b.index],f=function(){a._queue.stalled=false;g.toggleQuality(k.image,
a._options.imageQuality);e(i.container).css({zIndex:0,opacity:0});e(k.container).css({zIndex:1,opacity:1});a._controls.swap();a._options.imagePan&&a.addPan(k.image);c.link&&e(k.image).css({cursor:"pointer"}).bind(y(),function(){if(a._options.popupLinks)s.open(c.link,"_blank");else s.location.href=c.link});Array.prototype.shift.call(a._queue);a._queue.length&&a._show();a._playCheck();a.trigger({type:j.IMAGE,index:b.index,imageTarget:k.image,thumbTarget:m.image})};this._options.carousel&&this._options.carouselFollow&&
this._carousel.follow(b.index);if(this._options.preload){var h,n,o=this.getNext();try{for(n=this._options.preload;n>0;n--){h=new j.Picture;h.add(a.getData(o).image);o=a.getNext(o)}}catch(p){}}g.show(k.container);e(a._thumbnails[b.index].container).addClass("active").siblings(".active").removeClass("active");a.trigger({type:j.LOADSTART,cached:l,index:b.index,imageTarget:k.image,thumbTarget:m.image});k.load(d,function(q){a._scaleImage(q,{complete:function(r){g.show(r.container);"image"in i&&g.toggleQuality(i.image,
false);g.toggleQuality(r.image,false);a._queue.stalled=true;a.removePan();a.setInfo(b.index);a.setCounter(b.index);a.trigger({type:j.LOADFINISH,cached:l,index:b.index,imageTarget:r.image,thumbTarget:a._thumbnails[b.index].image});var w=i.image===null&&a._options.transitionInitial?a._options.transition_Initial:a._options.transition;w in G===false?f():G[w].call(a,{prev:i.image,next:r.image,rewind:b.rewind,speed:a._options.transitionSpeed||400},f)}})})}},getNext:function(a){a=typeof a==="number"?a:this.getIndex();
return a===this.getDataLength()-1?0:a+1},getPrev:function(a){a=typeof a==="number"?a:this.getIndex();return a===0?this.getDataLength()-1:a-1},next:function(){this.getDataLength()>1&&this.show(this.getNext(),false);return this},prev:function(){this.getDataLength()>1&&this.show(this.getPrev(),true);return this},get:function(a){return a in this._dom?this._dom[a]:null},getData:function(a){return a in this._data?this._data[a]:this._data[this._active]},getDataLength:function(){return this._data.length},
getIndex:function(){return typeof this._active==="number"?this._active:false},getStageHeight:function(){return this._stageHeight},getStageWidth:function(){return this._stageWidth},getOptions:function(a){return typeof a==="undefined"?this._options:this._options[a]},setOptions:function(a,b){if(typeof a==="object")e.extend(this._options,a);else this._options[a]=b;return this},play:function(a){this._playing=true;this._playtime=a||this._playtime;this._playCheck();this.trigger(j.PLAY);return this},pause:function(){this._playing=
false;this.trigger(j.PAUSE);return this},playToggle:function(a){return this._playing?this.pause():this.play(a)},isPlaying:function(){return this._playing},isFullscreen:function(){return this._fullscreen.active},_playCheck:function(){var a=this,b=0,c=g.timestamp(),d="play"+this._id;if(this._playing){g.clearTimer(d);var i=function(){b=g.timestamp()-c;if(b>=a._playtime&&a._playing){g.clearTimer(d);a.next()}else if(a._playing){a.trigger({type:j.PROGRESS,percent:Math.ceil(b/a._playtime*100),seconds:Math.floor(b/
1E3),milliseconds:b});g.addTimer(d,i,20)}};g.addTimer(d,i,20)}},setIndex:function(a){this._active=a;return this},setCounter:function(a){if(typeof a==="number")a++;else if(typeof a==="undefined")a=this.getIndex()+1;this.get("current").innerHTML=a;if(u){a=this.$("counter");var b=a.css("opacity"),c=a.attr("style");c&&parseInt(b,10)===1?a.attr("style",c.replace(/filter[^\;]+\;/i,"")):this.$("counter").css("opacity",b)}return this},setInfo:function(a){var b=this,c=this.getData(a);e.each(["title","description",
"author"],function(d,i){var k=b.$("info-"+i);c[i]?k[c[i].length?"show":"hide"]().html(c[i]):k.empty().hide()});return this},hasInfo:function(a){var b="title description".split(" "),c;for(c=0;b[c];c++)if(this.getData(a)[b[c]])return true;return false},jQuery:function(a){var b=this,c=[];e.each(a.split(","),function(i,k){k=e.trim(k);b.get(k)&&c.push(k)});var d=e(b.get(c.shift()));e.each(c,function(i,k){d=d.add(b.get(k))});return d},$:function(){return this.jQuery.apply(this,g.array(arguments))}};e.each(K,
function(a,b){var c=/_/.test(b)?b.replace(/_/g,""):b;j[b.toUpperCase()]="galleria."+c});e.extend(j,{IE9:u===9,IE8:u===8,IE7:u===7,IE6:u===6,IE:!!u,WEBKIT:/webkit/.test(x),SAFARI:/safari/.test(x),CHROME:/chrome/.test(x),QUIRK:u&&t.compatMode&&t.compatMode==="BackCompat",MAC:/mac/.test(navigator.platform.toLowerCase()),OPERA:!!s.opera,IPHONE:/iphone/.test(x),IPAD:/ipad/.test(x),ANDROID:/android/.test(x),TOUCH:!!(/iphone/.test(x)||/ipad/.test(x)||/android/.test(x))});j.addTheme=function(a){a.name||j.raise("No theme name specified");
a.defaults=typeof a.defaults!=="object"?{}:L(a.defaults);var b=false,c;if(typeof a.css==="string"){e("link").each(function(d,i){c=RegExp(a.css);if(c.test(i.href)){b=true;j.theme=a;return false}});b||e("script").each(function(d,i){c=RegExp("galleria\\."+a.name.toLowerCase()+"\\.");if(c.test(i.src)){b=i.src.replace(/[^\/]*$/,"")+a.css;g.addTimer("css",function(){g.loadCSS(b,"galleria-theme",function(){j.theme=a})},1)}});b||j.raise("No theme CSS loaded")}else j.theme=a;return a};j.loadTheme=function(a,
b){var c=false,d=C.length;j.theme=void 0;g.loadScript(a,function(){c=true});g.wait({until:function(){return c},error:function(){j.raise("Theme at "+a+" could not load, check theme path.",true)},success:function(){if(d){var i=[];e.each(j.get(),function(k,l){var m=e.extend(l._original.options,{data_source:l._data},b);l.$("container").remove();var f=new j;f._id=l._id;f.init(l._original.target,m);i.push(f)});C=i}},timeout:2E3})};j.get=function(a){if(C[a])return C[a];else if(typeof a!=="number")return C;
else j.raise("Gallery index "+a+" not found")};j.addTransition=function(a,b){G[a]=b};j.utils=g;j.log=function(){try{s.console.log.apply(s.console,g.array(arguments))}catch(a){try{s.opera.postError.apply(s.opera,arguments)}catch(b){s.alert(g.array(arguments).split(", "))}}};j.raise=function(a,b){if(E||b)throw Error((b?"Fatal error":"Error")+": "+a);};j.Picture=function(a){this.id=a||null;this.image=null;this.container=g.create("galleria-image");e(this.container).css({overflow:"hidden",position:"relative"});
this.original={width:0,height:0};this.loaded=this.ready=false};j.Picture.prototype={cache:{},add:function(a){var b=0,c=this,d=new Image,i=function(){if((!this.width||!this.height)&&b<1E3){b++;e(d).load(i).attr("src",a+"?"+(new Date).getTime())}c.original={height:this.height,width:this.width};c.cache[a]=a;c.loaded=true};e(d).css("display","block");if(c.cache[a]){d.src=a;i.call(d);return d}e(d).load(i).attr("src",a);return d},show:function(){g.show(this.image)},hide:function(){g.moveOut(this.image)},
clear:function(){this.image=null},isCached:function(a){return!!this.cache[a]},load:function(a,b){var c=this;e(this.container).empty(true);this.image=this.add(a);g.hide(this.image);e(this.container).append(this.image);g.wait({until:function(){return c.loaded&&c.image.complete&&c.original.width&&c.image.width},success:function(){s.setTimeout(function(){b.call(c,c)},50)},error:function(){s.setTimeout(function(){b.call(c,c)},50);j.raise("image not loaded in 10 seconds: "+a)},timeout:1E4});return this.container},
scale:function(a){a=e.extend({width:0,height:0,min:void 0,max:void 0,margin:0,complete:function(){},position:"center",crop:false},a);if(!this.image)return this.container;var b,c,d=this,i=e(d.container);g.wait({until:function(){b=a.width||i.width()||g.parseValue(i.css("width"));c=a.height||i.height()||g.parseValue(i.css("height"));return b&&c},success:function(){var k=(b-a.margin*2)/d.original.width,l=(c-a.margin*2)/d.original.height,m={"true":Math.max(k,l),width:k,height:l,"false":Math.min(k,l)}[a.crop.toString()];
if(a.max)m=Math.min(a.max,m);if(a.min)m=Math.max(a.min,m);e(d.container).width(b).height(c);e.each(["width","height"],function(o,p){e(d.image)[p](d.image[p]=d[p]=Math.round(d.original[p]*m))});var f={},h={};k=function(o,p,q){var r=0;if(/\%/.test(o)){o=parseInt(o,10)/100;p=d.image[p]||e(d.image)[p]();r=Math.ceil(p*-1*o+q*o)}else r=g.parseValue(o);return r};var n={top:{top:0},left:{left:0},right:{left:"100%"},bottom:{top:"100%"}};e.each(a.position.toLowerCase().split(" "),function(o,p){if(p==="center")p=
"50%";f[o?"top":"left"]=p});e.each(f,function(o,p){n.hasOwnProperty(p)&&e.extend(h,n[p])});f=f.top?e.extend(f,h):h;f=e.extend({top:"50%",left:"50%"},f);e(d.image).css({position:"relative",top:k(f.top,"height",c),left:k(f.left,"width",b)});d.show();d.ready=true;a.complete.call(d,d)},error:function(){j.raise("Could not scale image: "+d.image.src)},timeout:1E3});return this}};e.extend(e.easing,{galleria:function(a,b,c,d,i){if((b/=i/2)<1)return d/2*b*b*b*b+c;return-d/2*((b-=2)*b*b*b-2)+c},galleriaIn:function(a,
b,c,d,i){return d*(b/=i)*b*b*b+c},galleriaOut:function(a,b,c,d,i){return-d*((b=b/i-1)*b*b*b-1)+c}});e.fn.galleria=function(a){return this.each(function(){(new j).init(this,a)})};s.Galleria=j})(jQuery);


/***************************** POPUP ****************************/

function Floatbox() {
this.defaultOptions = {

/***** BEGIN OPTIONS CONFIGURATION *****/
// see docs/options.html for detailed descriptions

/*** <General Options> ***/
theme:          'black'    ,// 'auto'|'black'|'white'|'blue'|'yellow'|'red'|'custom'
padding:         12       ,// pixels
panelPadding:    8        ,// pixels
outerBorder:     2        ,// pixels
innerBorder:     2        ,// pixels
overlayOpacity:  85       ,// 0-100
controlOpacity:  60       ,// 0-100
autoSizeImages:  true     ,// true|false
autoSizeOther:   false    ,// true|false
resizeImages:    false     ,// true|false
resizeOther:     false    ,// true|false
resizeTool:     'cursor'  ,// 'cursor'|'topleft'|'both'
infoPos:        'bl'      ,// 'tl'|'tc'|'tr'|'bl'|'bc'|'br'
controlPos:     'br'      ,// 'tl'|'tr'|'bl'|'br'
boxLeft:        'auto'    ,// 'auto'|pixels|'[-]xx%'
boxTop:         'auto'    ,// 'auto'|pixels|'[-]xx%'
shadowType:     'drop'    ,// 'drop'|'halo'|'none'
shadowSize:      12       ,// 8|12|16|24
enableDrag:      true     ,// true|false
showCaption:     true     ,// true|false
showItemNumber:  true     ,// true|false
showClose:       true     ,// true|false
hideFlash:       true     ,// true|false
hideJava:        true     ,// true|false
disableScroll:   false    ,// true|false
autoGallery:     false    ,// true|false
preloadAll:      true     ,// true|false
enableCookies:   false    ,// true|false
cookieScope:    'site'    ,// 'site'|'folder'
language:       'auto'    ,// 'auto'|'en'|... (see the languages folder)
graphicsType:   'auto'    ,// 'auto'|'international'|'english'
urlGraphics:    'scripts/gallery/graphics/'   ,// change this if you install in another folder
urlLanguages:   'scripts/gallery/languages/'  ,// change this if you install in another folder
/*** </General Options> ***/

/*** <Navigation Options> ***/
navType:           'both'    ,// 'overlay'|'button'|'both'|'none'
navOverlayWidth:    35       ,// 0-50
navOverlayPos:      30       ,// 0-100
showNavOverlay:    'alwyas'   ,// 'always'|'once'|'never'
showHints:         'once'    ,// 'always'|'once'|'never'
enableWrap:         true     ,// true|false
enableKeyboardNav:  true     ,// true|false
outsideClickCloses: false     ,// true|false
numIndexLinks:      0        ,// number, -1 = no limit
indexLinksPanel:   'info' ,// 'info'|'control'
showIndexThumbs:    false     ,// true|false
/*** </Navigation Options> ***/

/*** <Animation Options> ***/
doAnimations:         true   ,// true|false
resizeDuration:       0.1    ,// 0-10
imageFadeDuration:    0.1    ,// 0-10
overlayFadeDuration:  0.1      ,// 0-10
splitResize:         'auto'    ,// 'no'|'auto'|'wh'|'hw'
startAtClick:         true   ,// true|false
zoomImageStart:       true   ,// true|false
liveImageResize:      true  ,// true|false
/*** </Animation Options> ***/

/*** <Slideshow Options> ***/
slideInterval:  3    ,// seconds
endTask:       'loop'  ,// 'stop'|'exit'|'loop'
showPlayPause:  true   ,// true|false
startPaused:    false  ,// true|false
pauseOnResize:  true   ,// true|false
pauseOnPrev:    true   ,// true|false
pauseOnNext:    false   // true|false
/*** </Slideshow Options> ***/
};

/*** <New Child Window Options> ***/
// Will inherit from the primary floatbox options unless overridden here
// Add any you like
this.childOptions = {
overlayOpacity:      45,
resizeDuration:       3,
imageFadeDuration:    3,
overlayFadeDuration:  0
};
/*** </New Child Window Options> ***/

/***** END OPTIONS CONFIGURATION *****/
this.init();
}
Floatbox.prototype = {
	panelGap: 22,
	infoLinkGap: 16,
	showHintsTime: 1600,
	zoomPopBorder: 1,
	controlSpacing: 8,
	minInfoWidth: 80,
	minIndexWidth: 120,
	ctrlJump: 5,
	slowLoadDelay: 750,
	loaderDelay: 200,
	autoSizeSpace: 4,
	initialSize: 120,
	defaultWidth: '85%',
	defaultHeight: '82%',
init: function() {
	this.setOptions(this.defaultOptions);
	if (typeof fbPageOptions === 'object') this.setOptions(fbPageOptions);
	this.setOptions(this.parseOptionString(location.search.substring(1)));
	this.items = [];
	this.nodeNames = [];
	this.hiddenEls = [];
	this.timeouts = {};
	this.pos = {};
	var path = this.urlGraphics;
	this.slowZoomImg = path + 'loading_white.gif';
	this.slowLoadImg = path + 'loading_black.gif';
	this.iframeSrc = path + 'loading_iframe.html';
	this.resizeUpCursor = path + 'magnify_plus.cur';
	this.resizeDownCursor = path + 'magnify_minus.cur';
	this.notFoundImg = path + '404.jpg';
	var agent = navigator.userAgent,
		version = navigator.appVersion;
	this.mac = version.indexOf('Macintosh') !== -1;
	if (window.opera) {
		this.opera = true;
		this.operaOld = parseFloat(version) < 9.5;
		this.operaMac = this.mac;
	} else if (document.all) {
		this.ie = true;
		this.ieOld = parseInt(version.substr(version.indexOf('MSIE') + 5), 10) < 7;
		this.ie8b2 = version.indexOf('MSIE 8.0') !== -1 && navigator.appMinorVersion === 'beta 2';
		this.ieXP = parseInt(version.substr(version.indexOf('Windows NT') + 11), 10) < 6;
	} else if (agent.indexOf('Firefox') !== -1) {
		this.ff = true;
		this.ffOld = parseInt(agent.substr(agent.indexOf('Firefox') + 8), 10) < 3;
		this.ffNew = !this.ffOld;
		this.ffMac = this.mac;
	} else if (version.indexOf('WebKit') !== -1) {
		this.webkit = true;
		this.webkitNew = parseInt(version.substr(version.indexOf('WebKit') + 7), 10) >= 500;
		this.webkitOld = !this.webkitNew;
		this.webkitMac = this.mac;
	}
	this.isChild = !!(self.fb && self.fb.fbBox);
	if (!this.isChild) {
		this.fbParent = this.lastChild = this;
		this.anchors = [];
		this.children = [];
		this.preloads = {};
		this.preloads.count = 0;
		this.html = document.documentElement;
		this.bod = document.body || document.getElementsByTagName('body')[0];
		this.rtl = this.getStyle(this.bod, 'direction') === 'rtl' || this.getStyle(this.html, 'direction') === 'rtl';
		this.xhr = this.getXMLHttpRequest();
		this.strings = {
			hintClose: 'Exit (key: Esc)',
			hintPrev: 'Previous (key: <--)',
			hintNext: 'Next (key: -->)',
			hintPlay: 'Play (key: spacebar)',
			hintPause: 'Pause (key: spacebar)',
			hintResize: 'Resize (key: Tab)',
			imgCount: 'Image %1 of %2',
			nonImgCount: 'Page %1 of %2',
			mixedCount: '(%1 of %2)',
			infoText: 'Info...',
			printText: 'Print...'
		};
  	} else {
		this.fbParent = fb.lastChild;
		fb.lastChild = this;
		fb.children.push(this);
		if (this.fbParent.isSlideshow) this.fbParent.setPause(true);
		this.anchors = fb.anchors;
		this.children = fb.children;
		this.html = fb.html;
		this.bod = fb.bod;
		this.rtl = fb.rtl;
		this.xhr = fb.xhr;
		this.strings = fb.strings;
	}
	this.browserLanguage = (navigator.language || navigator.userLanguage || navigator.systemLanguage || navigator.browserLanguage || 'en').substring(0, 2);
	if (!this.isChild) {
		var lang = this.language === 'auto' ? this.browserLanguage : this.language;
		if (this.xhr) {
			var that = this;
			this.xhr.getResponse(this.urlLanguages + lang + '.json', function(xhr) {
				if ((xhr.status === 200 || xhr.status === 203 || xhr.status === 304) && xhr.responseText) {
					var ltArrow = String.fromCharCode(8592),
						rtArrow = String.fromCharCode(8594),
						text = xhr.responseText;
					if (that.ieXP) {
						text = text.replace(ltArrow, '<--').replace(rtArrow, '-->');
					}
					try {
						var obj = eval('(' + text + ')');
						if (obj && obj.hintClose) that.strings = obj;
					} catch(e) {}
				}
				if (that.rtl) {
					if (!/^(ar|he)$/.test(that.language)) {
						that.strings.infoText = that.strings.infoText.replace('...', '');
						that.strings.printText = that.strings.printText.replace('...', '');
					}
					that.strings.hintPrev = that.strings.hintPrev.replace(ltArrow, rtArrow).replace('-->', '<--');
					that.strings.hintNext = that.strings.hintNext.replace(rtArrow, ltArrow).replace('<--', '-->');
					var t = that.strings.hintPrev;
					that.strings.hintPrev = that.strings.hintNext;
					that.strings.hintNext = t;
				}
			});
		}
	}
	if (!this.rtl && (this.graphicsType.toLowerCase() === 'english' || (this.graphicsType === 'auto' && this.browserLanguage === 'en'))) {
		this.offPos = 'top left';
		this.onPos = 'bottom left';
	} else {
		this.offPos = 'top right';
		this.onPos = 'bottom right';
		this.controlSpacing = 0;
	}
	this.zIndex = {
		base: 90000 + 10*this.children.length,
		fbOverlay: 1,
		fbBox: 2,
		fbCanvas: 3,
		fbMainDiv: 4,
		fbLeftNav: 5,
		fbRightNav: 5,
		fbOverlayPrev: 6,
		fbOverlayNext: 6,
		fbResizer: 7,
		fbZoomDiv: 8,
		fbInfoPanel: 8,
		fbControlPanel: 8
	};
	var match = /\bautoStart=(.+?)(?:&|$)/i.exec(location.search);
	this.autoHref = match ? match[1] : false;
},
tagAnchors: function(baseEl) {
	var that = fb.lastChild,
		doOutline = this.ieOld && /^fb/.test(baseEl.id);
	function tag(tagName) {
		var elements = baseEl.getElementsByTagName(tagName);
		for (var i = 0, len = elements.length; i < len; i++) {
			var el = elements[i],
				revOptions = that.parseOptionString(el.getAttribute('rev')),
				href = revOptions.href || el.getAttribute('href');
			if (that.autoGallery && that.fileType(href) === 'img' && el.getAttribute('rel') !== 'nofloatbox') {
				el.setAttribute('rel', 'floatbox.autoGallery');
				if (that.autoTitle && !el.getAttribute('title')) el.setAttribute('title', that.autoTitle);
			}
			if (doOutline) el.setAttribute('hideFocus', 'true');
			that.tagOneAnchor(el, revOptions);
		}
	}
	tag('a');
	tag('area');
},
tagOneAnchor: function(anchor, revOptions) {
	var that = this,
		isAnchor = !!anchor.getAttribute;
	if (isAnchor) {
		var a = {
			rel: anchor.getAttribute('rel'),
			rev: anchor.getAttribute('rev'),
			title: anchor.getAttribute('title'),
			anchor: anchor,
			thumb: this.getThumb(anchor)
		};
		var match;
		if (a.thumb && (match = /(?:^|\s)fbPop(up|down)(?:\s|$)/i.exec(anchor.className))) {
			var up = (match[1] === 'up');
			a.popup = true;
			a.thumb.style.borderWidth = this.zoomPopBorder + 'px';
			anchor.onmouseover = function () {
				a.thumb.style.display = 'none';
				var aPos = that.getLeftTop(this, true),
					aLeft = aPos.left,
					aTop = aPos.top;
				aPos = that.getLayout(this);
				a.thumb.style.display = '';
				var relLeft = (aPos.width - a.thumb.offsetWidth)/2,
					relTop = up ? 2 - a.thumb.offsetHeight : aPos.height,
					scroll = that.getScroll(),
					screenRight = scroll.left + that.getDisplayWidth();
				var spill = aPos.left + relLeft + a.thumb.offsetWidth - screenRight;
				if (spill > 0) relLeft -= spill;
				var spill = aPos.left + relLeft - scroll.left;
				if (spill < 0) relLeft -= spill;
				if (up) {
					if (aPos.top + relTop < scroll.top) relTop = aPos.height;
				} else {
					if (aPos.top + relTop + a.thumb.offsetHeight > scroll.top + that.getDisplayHeight()) relTop = 2 - a.thumb.offsetHeight;
				}
				a.thumb.style.left = (aLeft + relLeft) + 'px';
				a.thumb.style.top = (aTop + relTop) + 'px';
			};
			anchor.onmouseout = function () {
				a.thumb.style.left = '0';
				a.thumb.style.top = '-9999px';
			};
			if (!anchor.onclick) anchor.onclick = anchor.onmouseout;
		}
	} else {
		var a = anchor;
	}
	if (/^(floatbox|gallery|iframe|slideshow|lytebox|lyteshow|lyteframe|lightbox)/i.test(a.rel)) {
		a.revOptions = revOptions || this.parseOptionString(a.rev);
		a.href = a.revOptions.href || anchor.href || anchor.getAttribute('href');
		a.level = this.children.length + (fb.lastChild.fbBox && !a.revOptions.sameBox ? 1 : 0);
		var a_i, i = this.anchors.length;
		while (i--) {
			a_i = this.anchors[i];
			if (a_i.href === a.href && a_i.rel === a.rel && a_i.rev === a.rev && a_i.title === a.title && a_i.level === a.level) {
				a_i.anchor = anchor;
				break;
			}
		}
		if (i === -1) {
			a.type = a.revOptions.type || this.fileType(a.href);
			if (a.type === 'html') {
				a.type = 'iframe';
				var match = /#(\w+)/.exec(a.href);
				if (match) {
					var doc = document;
					if (a.anchor) {
						doc = a.anchor.ownerDocument || a.anchor.document || doc;
					}
					if (doc === document && this.currentItem && this.currentItem.anchor) {
						doc = this.currentItem.anchor.ownerDocument || this.currentItem.anchor.document || doc;
					}
					var el = doc.getElementById(match[1]);
					if (el) {
						a.type = 'inline';
						a.sourceEl = el;
					}
				}
			}
			this.anchors.push(a);
			if (this.autoHref) {
				if (a.revOptions.showThis !== false && this.autoHref === a.href.substr(a.href.length - this.autoHref.length)) this.autoStart = a;
			} else if (a.revOptions.autoStart === true) {
				this.autoStart = a;
			} else if (a.revOptions.autoStart === 'once') {
				var match = /fbAutoShown=(.+?)(?:;|$)/.exec(document.cookie),
					val = match ? match[1] : '',
					href = escape(a.href);
				if (val.indexOf(href) === -1) {
					this.autoStart = a;
					document.cookie = 'fbAutoShown=' + val + href + '; path=/';
				}
			}
		}
		if (isAnchor) {
			anchor.onclick = function(e) {
				e = e || window.event;
				if (this.ie && !e) {
					var iframes = self.frames, i = iframes.length;
					while (i-- && !e) {
						try {
							if (typeof iframes[i].window === 'object') e = iframes[i].window.event;
						} catch(err) {}
					}
				}
				if (!(e && (e.ctrlKey || e.metaKey || e.shiftKey)) || a.revOptions.showThis === false || !/img|iframe/.test(a.type)) {
					fb.start(this);
					if (this.ie && e) e.returnValue = false;
					return false;
				}
			};
		}
	}
	return a;
},
fileType: function(href) {
	var s = href.toLowerCase(),
		i = s.indexOf('?');
	if (i !== -1) s = s.substr(0, i);
	s = s.substr(s.lastIndexOf('.') + 1);
	if (/^(jpe?g|png|gif|bmp)$/.test(s)) return 'img';
	if (s === 'swf' || /^(http:)?\/\/(www.)?youtube.com\/v\//i.test(href)) return 'flash';
	if (/^(mov|mpe?g|movie)$/.test(s)) return 'quicktime';
	return 'html';
},
preloadImages: function(href, chain) {
	if (this !== fb) return fb.preloadImages(href, chain);
	if (typeof chain !== 'undefined') arguments.callee.chain = chain;
	if (!href && arguments.callee.chain && (this.preloadAll || !this.preloads.count)) {
		for (var i = 0, len = this.anchors.length; i < len; i++) {
			var a = this.anchors[i];
			if (a.type === 'img' && !this.preloads[a.href]) {
				href = a.href;
				break;
			}
		}
	}
	if (href) {
		if (this.preloads[href]) {
			this.preloadImages();
		} else {
			var img = this.preloads[href] = new Image();
			img.onerror = function() {
				setTimeout(function() { fb.preloadImages(); }, 50);
				fb.preloads[href] = true;
			};
			img.onload = function() {
				fb.preloads.count++;
				this.onerror();
			};
			img.src = href;
		}
	}
},
start: function(anchor) {
	if (this !== fb.lastChild) return fb.lastChild.start(anchor);
	var that = this;
	this.preloadImages('', false);
	if (anchor.getAttribute) {
		var a = {
			rel: anchor.getAttribute('rel'),
			rev: anchor.getAttribute('rev'),
			title: anchor.getAttribute('title')
		};
		a.revOptions = this.parseOptionString(a.rev);
		a.href = a.revOptions.href || anchor.href || anchor.getAttribute('href');
		anchor.blur();
	} else {
		var a = anchor;
	}
	this.isRestart = !!this.fbBox;
	if (this.isRestart) {
		if (!a.revOptions.sameBox) return new Floatbox().start(anchor);
		this.setOptions(a.revOptions);
	} else {
		this.clickedAnchor = anchor.getAttribute ? anchor : false;
	}
	a.level = this.children.length + (fb.lastChild.fbBox && !a.revOptions.sameBox ? 1 : 0);
	this.itemsShown = 0;
	fb.previousAnchor = this.currentItem;
	this.buildItemArray(a);
	if (!this.itemCount) return;
	if (this.itemCount === 1 && this.fbNavControls) this.fbNavControls.style.display = 'none';
	self.focus();
	this.revOptions = a.revOptions;
	if (!this.isRestart) {
		this.getOptions();
		this.buildDOM();
		this.addEventHandlers();
		this.initState();
	}
	this.collapse();
	this.updatePanels();
	var fetchAndGo = function() {
		that.fetchContent(function() {
			that.clearTimeout('slowLoad');
			that.calcSize();
		} );
	};
	if (this.fbBox.style.visibility  || this.isRestart) {
		fetchAndGo();
	} else {
		var offset = this.initialSize/2,
			size = { id: 'fbBox', left: that.pos.fbBox.left - offset, top: that.pos.fbBox.top - offset,
			width: that.initialSize, height: that.initialSize, borderWidth: that.outerBorder };
		if (this.splitResize) {
			var oncomplete = function() {
				that.setSize(fetchAndGo, size);
			};
		} else {
			this.timeouts.slowLoad = setTimeout(function() {
				that.setSize(size);
			}, this.slowLoadDelay);
			var oncomplete = fetchAndGo;
		}
		this.fadeOpacity(this.fbOverlay, this.overlayOpacity, this.overlayFadeDuration, oncomplete);
	}
},
buildItemArray: function(a) {
	this.itemCount = this.items.length = this.currentIndex = 0;
	this.justImages = true;
	this.hasImages = false;
	var isSingle = /^(floatbox|gallery|iframe|lytebox|lyteframe|lightbox)$/i.test(a.rel);
	for (var i = 0, len = this.anchors.length; i < len; i++) {
		var a_i = this.anchors[i];
		if (a_i.rel === a.rel && a_i.level === a.level) {
			if (a_i.revOptions.showThis !== false) {
				var isMatch = a_i.rev === a.rev && a_i.title === a.title && a_i.href === a.href.substr(a.href.length - a_i.href.length);
				if (isMatch || !isSingle) {
					a_i.seen = false;
					this.items.push(a_i);
					if (a_i.type === 'img') {
						this.hasImages = true;
					} else {
						this.justImages = false;
					}
					if (isMatch) this.currentIndex = this.items.length - 1;
				}
			}
		}
	}
	if (a.revOptions.showThis === false && a.href) {
		i = this.items.length;
		while (i--) {
			var href = this.items[i].href;
			if (href === a.href.substr(a.href.length - href.length)) {
				this.currentIndex = i;
			}
		}
	}
  	this.itemCount = this.items.length;
  	this.currentItem = this.items[this.currentIndex];
},
getOptions: function() {
	if (this.isChild) {
		for (var name in this.defaultOptions) {
			if (this.defaultOptions.hasOwnProperty(name)) this[name] = this.fbParent[name];
		}
		this.setOptions(this.childOptions);
	} else {
		this.setOptions(this.defaultOptions);
	}
	this.doSlideshow = this.loadPageOnClose = this.sameBox = false;
	if (!(this.isChild || this.fbBox)) {
		if (typeof setFloatboxOptions === 'function') setFloatboxOptions();
		if (typeof fbPageOptions === 'object') this.setOptions(fbPageOptions);
		if (this.enableCookies) {
			var match = /fbOptions=(.+?)(;|$)/.exec(document.cookie);
			if (match) this.setOptions(this.parseOptionString(match[1]));
			var strOptions = '';
			for (var name in this.defaultOptions) {
				if (this.defaultOptions.hasOwnProperty(name)) {
					strOptions += ' ' + name + ':' + this[name];
				}
			}
			var strPath = '/';
			if (this.cookieScope === 'folder') {
				strPath = location.pathname;
				strPath = strPath.substring(0, strPath.lastIndexOf('/') + 1);
			}
			document.cookie = 'fbOptions=' + strOptions + '; path=' + strPath;
		}
	}
	this.setOptions(this.revOptions);
	this.setOptions(this.parseOptionString(location.search.substring(1)));
	if (this.theme === 'grey') this.theme = 'white';
	if (this.endTask === 'cont') this.endTask = 'loop';
	if (this.navType === 'upper') this.navType = 'overlay';
	if (this.navType === 'lower') this.navType = 'button';
	if (this.upperOpacity) this.controlOpacity = this.upperOpacity;
	if (this.upperNavWidth) this.navOverlayWidth = this.upperNavWidth;
	if (this.upperNavPos) this.navOverlayPos = this.upperNavPos;
	if (this.showUpperNav) this.showNavOverlay = this.showUpperNav;
	if (this.dropShadow) this.shadowType = 'drop';
	if (!/^(auto|black|white|blue|yellow|red|custom)$/.test(this.theme)) this.theme='auto';
	if (!/^(overlay|button|both|none)$/i.test(this.navType)) this.navType = 'button';
	if (!/^(auto|wh|hw)$/.test(this.splitResize)) this.splitResize = false;
	if (this.webkitOld && (this.navType === 'overlay' || this.navType === 'both') ) {
		this.navType = 'button';
	}
	if (this.itemCount > 1) {
		this.isSlideshow = this.doSlideshow || /^(slideshow|lyteshow)/i.test(this.currentItem.rel);
		var overlayRequest = /overlay|both/i.test(this.navType),
			buttonRequest = /button|both/i.test(this.navType);
		this.navOverlay = this.justImages && overlayRequest;
		this.navButton = buttonRequest || (!this.justImages && overlayRequest);
		this.lclShowItemNumber = this.showItemNumber;
		this.lclNumIndexLinks = this.numIndexLinks;
	} else {
		this.isSlideshow = this.navOverlay = this.navButton = this.lclShowItemNumber = this.lclNumIndexLinks = false;
	}
	this.isPaused = this.startPaused;
	if ((this.lclTheme = this.theme) === 'auto') {
		this.lclTheme = this.currentItem.type === 'img' ? 'black' : /flash|quicktime/.test(this.currentItem.type) ? 'blue' : 'white';
	}
	if (!this.doAnimations) {
		this.resizeDuration = this.imageFadeDuration = this.overlayFadeDuration = 0;
	}
	if (!this.resizeDuration) this.zoomImageStart = false;
	if (!/[tb][lr]/.test(this.controlPos)) this.controlPos = '';
	if (!/[tb][lcr]/.test(this.infoPos)) this.infoPos = '';
	this.controlTop = this.controlPos.charAt(0) === 't';
	this.controlLeft = this.controlPos.charAt(1) === 'l';
	this.infoTop = this.infoPos.charAt(0) === 't';
	this.infoCenter = this.infoPos.charAt(1) === 'c';
	this.infoLeft = this.infoPos.charAt(1) === 'l' || (this.infoCenter && this.controlTop === this.infoTop && !this.controlLeft);
	if (this.infoLeft === this.controlLeft && this.infoTop === this.controlTop) {
		this.infoLeft = true;
		this.controlLeft = false;
	}
	if (this.indexLinksPanel === 'info') {
		this.indexCenter = this.infoCenter;
		this.indexLeft = this.infoLeft;
		this.indexTop = this.infoTop;
	} else {
		this.indexLeft = this.controlLeft;
		this.indexTop = this.controlTop;
	}
	if (!/^(drop|halo|none)$/.test(this.shadowType)) this.shadowType='drop';
	if (!/^(8|12|16|24)$/.test(this.shadowSize + '')) this.shadowSize = 8;
	this.shadowSize = +this.shadowSize;
	if (this.opera || (this.mac && !this.webkitNew)) {
		this.resizeTool = 'topleft';
	} else {
		this.resizeTool = this.resizeTool.toLowerCase();
		if (!/topleft|cursor|both/.test(this.resizeTool)) this.resizeTool = 'cursor';
	}
	if (this.ieOld) this.shadowType = 'none';
	if (this.padding + this.outerBorder === 0) this.zoomPopBorder = 0;
	if (this.overlayOpacity > 1) this.overlayOpacity /= 100;
	if (this.controlOpacity > 1) this.controlOpacity /= 100;
},
parseOptionString: function(str) {
	if (!str) return {};
	var quotes = [], match,
		rex = /`([^`]*?)`/g;
	while ((match = rex.exec(str))) quotes.push(match[1]);
	if (quotes.length) str = str.replace(rex, '``');
	str = str.replace(/\s*[:=]\s*/g, ':');
	str = str.replace(/\s*[;&]\s*/g, ' ');
	str = str.replace(/^\s+|\s+$/g, '');
	var pairs = {},
		aVars = str.split(' '),
		i = aVars.length;
	while (i--) {
		var aThisVar = aVars[i].split(':'),
			name = aThisVar[0],
			value = aThisVar[1];
		if (typeof value === 'string') {
			if (!isNaN(value)) value = +value;
			else if (value === 'true') value = true;
			else if (value === 'false') value = false;
		}
		if (value === '``') value = quotes.pop() || '';
		pairs[name] = value;
	}
	return pairs;
},
setOptions: function(pairs) {
	for (var name in pairs) {
		if (pairs.hasOwnProperty(name)) this[name] = pairs[name];
	}
},
buildDOM: function() {
	this.fbOverlay		= this.newNode('div', 'fbOverlay', this.bod);
	this.fbZoomDiv		= this.newNode('div', 'fbZoomDiv', this.bod);
	this.fbZoomImg		= this.newNode('img', 'fbZoomImg', this.fbZoomDiv);
	this.fbBox			= this.newNode('div', 'fbBox');
	this.fbShadowTop	= this.newNode('div', 'fbShadowTop', this.fbBox);
	this.fbShadowRight	= this.newNode('div', 'fbShadowRight', this.fbBox);
	this.fbShadowBottom	= this.newNode('div', 'fbShadowBottom', this.fbBox);
	this.fbShadowLeft	= this.newNode('div', 'fbShadowLeft', this.fbBox);
	this.fbShadowCorner	= this.newNode('div', 'fbShadowCorner', this.fbBox);
	this.fbLoader		= this.newNode('div', 'fbLoader', this.fbBox);
	this.fbCanvas		= this.newNode('div', 'fbCanvas', this.fbBox);
	this.fbMainDiv		= this.newNode('div', 'fbMainDiv', this.fbCanvas);
	this.fbLeftNav		= this.newNode('a', 'fbLeftNav', this.fbMainDiv);
	this.fbRightNav		= this.newNode('a', 'fbRightNav', this.fbMainDiv);
	this.fbOverlayPrev	= this.newNode('a', 'fbOverlayPrev', this.fbMainDiv, this.strings.hintPrev);
	this.fbOverlayNext	= this.newNode('a', 'fbOverlayNext', this.fbMainDiv, this.strings.hintNext);
	this.fbResizer		= this.newNode('a', 'fbResizer', this.fbMainDiv, this.strings.hintResize);
	this.fbInfoPanel	= this.newNode('div', 'fbInfoPanel', this.fbCanvas);
	this.fbCaptionDiv	= this.newNode('div', 'fbCaptionDiv', this.fbInfoPanel);
	this.fbCaption		= this.newNode('span', 'fbCaption', this.fbCaptionDiv);
	this.fbInfoDiv		= this.newNode('div', 'fbInfoDiv', this.fbInfoPanel);
	if (this.infoLeft || this.infoCenter) {
		this.fbInfoLink		= this.newNode('span', 'fbInfoLink', this.fbInfoDiv);
		this.fbPrintLink	= this.newNode('span', 'fbPrintLink', this.fbInfoDiv);
		this.fbItemNumber	= this.newNode('span', 'fbItemNumber', this.fbInfoDiv);
	} else {
		this.fbItemNumber	= this.newNode('span', 'fbItemNumber', this.fbInfoDiv);
		this.fbPrintLink	= this.newNode('span', 'fbPrintLink', this.fbInfoDiv);
		this.fbInfoLink		= this.newNode('span', 'fbInfoLink', this.fbInfoDiv);
	}
	this.fbControlPanel	= this.newNode('div', 'fbControlPanel', this.fbCanvas);
	this.fbControls		= this.newNode('div', 'fbControls', this.fbControlPanel);
	this.fbNavControls	= this.newNode('div', 'fbNavControls', this.fbControls);
	this.fbPrev			= this.newNode('a', 'fbPrev', this.fbNavControls, this.strings.hintPrev);
	this.fbNext			= this.newNode('a', 'fbNext', this.fbNavControls, this.strings.hintNext);
	this.fbSubControls	= this.newNode('div', 'fbSubControls', this.fbControls);
	this.fbPlayPause	= this.newNode('div', 'fbPlayPause', this.fbSubControls);
	this.fbPlay			= this.newNode('a', 'fbPlay', this.fbPlayPause, this.strings.hintPlay);
	this.fbPause		= this.newNode('a', 'fbPause', this.fbPlayPause, this.strings.hintPause);
	this.fbClose		= this.newNode('a', 'fbClose', this.fbSubControls, this.strings.hintClose);
	this.fbIndexLinks	= this.newNode('span', 'fbIndexLinks', this.indexLinksPanel === 'info' ? this.fbInfoPanel : this.fbControlPanel);
	this.bod.appendChild(this.fbBox);
},
newNode: function(nodeType, id, parentNode, title) {
	if (this[id] && this[id].parentNode) {
		this[id].parentNode.removeChild(this[id]);
	}
	var node = document.createElement(nodeType);
	node.id = id;
	node.className = id + '_' + (id.indexOf('fbShadow') === -1 ? this.lclTheme : this.shadowType + this.shadowSize);
	if (nodeType === 'a') {
		if (!this.operaOld) node.setAttribute('href', '');
		if (this.ieOld) node.setAttribute('hideFocus', 'true');
		node.style.outline = 'none';
	} else if (nodeType === 'iframe') {
		node.setAttribute('scrolling', this.itemScroll);
		node.setAttribute('frameBorder', '0');
		node.setAttribute('align', 'middle');
		node.src = this.iframeSrc;
	}
	if (this.isChild && this.fbParent[id]) title = this.fbParent[id].getAttribute('title');
	if (title && this.showHints !== 'never') node.setAttribute('title', title);
	if (this.zIndex[id]) node.style.zIndex = this.zIndex.base + this.zIndex[id];
	node.style.display = 'none';
	if (parentNode) parentNode.appendChild(node);
	this.nodeNames.push(id);
	return node;
},
addEventHandlers: function() {
	var that = this,
	leftNav = this.fbLeftNav.style,
	rightNav = this.fbRightNav.style,
	overlayPrev = this.fbOverlayPrev.style,
	overlayNext = this.fbOverlayNext.style,
	prev = this.fbPrev.style,
	next = this.fbNext.style;
	if (this.showHints === 'once') {
		this.hideHint = function(id) {
			if (that[id].title) {
				that.timeouts[id] = setTimeout(function() {
					that[id].title = that.fbParent[id].title = '';
					var id2 = '';
					if (/fbOverlay(Prev|Next)/.test(id)) {
						id2 = id.replace('Overlay', '');
					} else if (/fb(Prev|Next)/.test(id)) {
						id2 = id.replace('fb', 'fbOverlay');
					}
					if (id2) that[id2].title = that.fbParent[id2].title = '';
				}, that.showHintsTime);
			}
		};
	} else {
		this.hideHint = function() {};
	}
	this.fbPlay.onclick = function() {
		that.setPause(false);
		if (window.event) event.returnValue = false;
		return false;
	};
	this.fbPause.onclick = function() {
		that.setPause(true);
		if (window.event) event.returnValue = false;
		return false;
	};
	this.fbClose.onclick = function() {
		that.end();
		if (window.event) event.returnValue = false;
		return false;
	};
	if (this.outsideClickCloses) {
		this.fbOverlay.onclick = this.fbShadowTop.onclick = this.fbShadowRight.onclick =
		this.fbShadowBottom.onclick = this.fbShadowLeft.onclick = this.fbShadowCorner.onclick = this.fbClose.onclick;
	}
	this[this.rtl ? 'fbNext' : 'fbPrev'].onclick = function(step) {
		if (typeof step !== 'number') step = 1;
		var newIndex = (that.currentIndex - step) % that.itemCount;
		if (newIndex < 0) newIndex += that.itemCount;
		if (that.enableWrap || newIndex < that.currentIndex) {
			that.newContent(newIndex);
			if (that.isSlideshow && that.pauseOnPrev && !that.isPaused) {
				that.setPause(true);
			}
		}
		if (window.event) event.returnValue = false;
		return false;
	};
	this[this.rtl ? 'fbPrev' : 'fbNext'].onclick = function(step) {
		if (typeof step !== 'number') step = 1;
		var newIndex = (that.currentIndex + step) % that.itemCount;
		if (that.enableWrap || newIndex > that.currentIndex) {
			that.newContent(newIndex);
			if (that.isSlideshow && that.pauseOnNext && !that.isPaused) {
				that.setPause(true);
			}
		}
		if (window.event) event.returnValue = false;
		return false;
	};
	this.fbLeftNav.onclick = this.fbOverlayPrev.onclick = this.fbPrev.onclick;
	this.fbRightNav.onclick = this.fbOverlayNext.onclick = this.fbNext.onclick;
	this.fbLeftNav.onmouseover = this.fbLeftNav.onmousemove =
	this.fbOverlayPrev.onmousemove = function() {
		if (!that.timeouts.fbCanvas) overlayPrev.visibility = '';
		if (that.navButton) prev.backgroundPosition = that.onPos;
		return true;
	};
	this.fbRightNav.onmouseover = this.fbRightNav.onmousemove =
	this.fbOverlayNext.onmousemove = function() {
		if (!that.timeouts.fbCanvas) overlayNext.visibility = '';
		if (that.navButton) next.backgroundPosition = that.onPos;
		return true;
	};
	this.fbOverlayPrev.onmouseover = this.fbOverlayNext.onmouseover = function() {
		this.onmousemove();
		that.hideHint(this.id);
		return true;
	};
	this.fbLeftNav.onmouseout = function() {
		overlayPrev.visibility = 'hidden';
		if (that.navButton) prev.backgroundPosition = that.offPos;
	};
	this.fbRightNav.onmouseout = function() {
		overlayNext.visibility = 'hidden';
		if (that.navButton) next.backgroundPosition = that.offPos;
	};
	this.fbOverlayPrev.onmouseout = this.fbOverlayNext.onmouseout = function() {
		this.style.visibility = 'hidden';
		that.clearTimeout(this.id);
	};
	this.fbLeftNav.onmousedown = this.fbRightNav.onmousedown = function(e) {
		e = e || window.event;
		if (e.button === 2) {
			leftNav.visibility = rightNav.visibility = 'hidden';
			that.timeouts.hideNavOverlay = setTimeout(function() {
				leftNav.visibility = rightNav.visibility = '';
			}, 600);
		}
	};
	this.fbPlay.onmouseover = this.fbPause.onmouseover = this.fbClose.onmouseover =
	this.fbPrev.onmouseover = this.fbNext.onmouseover = function() {
		this.style.backgroundPosition = that.onPos;
		that.hideHint(this.id);
		return true;
	};
	this.fbResizer.onmouseover = function() {
		that.hideHint(this.id);
		return true;
	};
	this.fbPlay.onmouseout = this.fbPause.onmouseout = this.fbClose.onmouseout =
	this.fbPrev.onmouseout = this.fbNext.onmouseout = function() {
		this.style.backgroundPosition = that.offPos;
		that.clearTimeout(this.id);
	};
	this.fbResizer.onmouseout = function() {
		that.clearTimeout(this.id);
	};
	if (this.enableKeyboardNav) {
		if (!document.keydownSet) {
			this.priorOnkeydown = document.onkeydown;
			document.onkeydown = this.keydownHandler;
			document.keydownSet = true;
		}
	} else if (document.keydownSet) {
		document.onkeydown = this.priorOnkeydown;
		document.keydownSet = false;
	}
	if (this.opera && !document.keypressSet) {
		this.priorOnkeypress = document.onkeypress;
		document.onkeypress = function() { return false; };
		document.keypressSet = true;
	}
	if (this.enableDrag) this.fbBox.onmousedown = this.dragonDrop();
},
keydownHandler: function(e) {
	e = e || window.event;
	var that = fb.lastChild,
		keyCode = e.keyCode || e.which;
	switch (keyCode) {
		case 37: case 39:
			if (that.itemCount > 1) {
				that[keyCode === 37 ? 'fbPrev' : 'fbNext'].onclick((e.ctrlKey || e.metaKey) ? that.ctrlJump : 1);
				if (that.showHints === 'once') {
					that.fbPrev.title = that.fbNext.title =
					that.fbOverlayPrev.title = that.fbOverlayNext.title = '';
				}
			}
			return false;
		case 32:
			if (that.isSlideshow) {
				that.setPause(!that.isPaused);
				if (that.showHints === 'once') that.fbPlay.title = that.fbPause.title = '';
			}
			return false;
		case 9:
			if (that.fbResizer.onclick) {
				that.fbResizer.onclick();
				if (that.showHints === 'once') that.fbResizer.title = '';
			}
			return false;
		case 27:
			if (that.showHints === 'once') that.fbClose.title = '';
			that.end();
			return false;
		case 13:
			return false;
	}
},
dragonDrop: function() {
	var that = this,
		fbBox = this.fbBox;
	return function(e) {
		e = e || window.event;
		if (/fb(Box|Canvas|Info|Caption|Item|Control|Index)/.test((e.target || e.srcElement).id)) {
			var startX = e.clientX,
				startY = e.clientY,
				box = that.fbBox.style,
				content = that.fbContent.style,
				pos = that.pos.fbBox,
				boxX = pos.left,
				boxY = pos.top;
			pos.dx = pos.dy = 0;
			var moveHandler = function(e) {
				if (that.currentItem.type === 'iframe' && !(that.ie || that.opera) && !content.visibility) content.visibility = 'hidden';
				if (that.isSlideshow && !that.isPaused) that.setPause(true);
				e = e || window.event;
				pos.dx = e.clientX - startX;
				pos.dy = e.clientY - startY;
				box.left = (boxX + pos.dx) + 'px';
				box.top = (boxY + pos.dy) + 'px';
				(e.stopPropagation && e.stopPropagation()) || (e.cancelBubble = true);
				that.clearTimeout('dragonDrop');
				that.timeouts.dragonDrop = setTimeout(upHandler, 1500);
				return false;
			};
			var upHandler = function(e) {
				that.clearTimeout('dragonDrop');
				e = e || window.event;
				if (document.removeEventListener) {
					document.removeEventListener("mouseup", upHandler, true);
					document.removeEventListener("mousemove", moveHandler, true);
				} else if (fbBox.detachEvent) {
					fbBox.detachEvent("onlosecapture", upHandler);
					fbBox.detachEvent("onmouseup", upHandler);
					fbBox.detachEvent("onmousemove", moveHandler);
					fbBox.releaseCapture();
				}
				if (e) (e.stopPropagation && e.stopPropagation()) || (e.cancelBubble = true);
				pos.left += pos.dx;
				pos.top += pos.dy;
				content.visibility = '';
				return false;
			};
			if (document.addEventListener) {
				document.addEventListener("mousemove", moveHandler, true);
				document.addEventListener("mouseup", upHandler, true);
			} else if (fbBox.attachEvent) {
				fbBox.setCapture();
				fbBox.attachEvent("onmousemove", moveHandler);
				fbBox.attachEvent("onmouseup", upHandler);
				fbBox.attachEvent("onlosecapture", upHandler);
			}
			return false;
		}
	};
},
initState: function() {
	var that = this,
		box = this.fbBox.style,
		mainDiv = this.fbMainDiv.style,
		canvas = this.fbCanvas.style,
		zoomDiv = this.fbZoomDiv.style,
		zoomImg = this.fbZoomImg.style;
	if (this.currentItem.popup) this.currentItem.anchor.onmouseover();
	var anchorPos = this.getAnchorPos(this.clickedAnchor, this.currentItem.anchor === this.clickedAnchor && this.currentItem.type === 'img');
	if (anchorPos.width) {
		this.pos.fbZoomDiv = anchorPos;
		zoomDiv.borderWidth = this.zoomPopBorder + 'px';
		zoomDiv.left = (anchorPos.left - this.zoomPopBorder) + 'px';
		zoomDiv.top = (anchorPos.top - this.zoomPopBorder) + 'px';
		zoomDiv.width = (this.fbZoomImg.width = anchorPos.width) + 'px';
		zoomDiv.height = (this.fbZoomImg.height = anchorPos.height) + 'px';
		this.fbZoomImg.src = anchorPos.src;
		box.visibility = 'hidden';
		this.timeouts.slowLoad = setTimeout(function() {
			if (that.fbOverlay.style.display) that.fadeOpacity(that.fbOverlay, that.overlayOpacity, that.overlayFadeDuration);
			that.fbZoomImg.src = that.slowZoomImg;
			zoomDiv.display = zoomImg.display = '';
		}, this.slowLoadDelay);
	} else {
		this.pos.fbBox = anchorPos;
		this.pos.fbBox.borderWidth = 0;
		this.pos.fbMainDiv = { width:0, height:0 };
	}
	box.position = 'absolute';
	box.left = box.top = box.width = box.height = box.borderWidth = '0';
	mainDiv.borderWidth = this.innerBorder + 'px';
	mainDiv.left = this.padding + 'px';
	this.fbControlPanel.style[this.controlLeft ? 'left' : 'right'] =
	this.fbInfoPanel.style[this.infoLeft ? 'left' : 'right'] = Math.max(this.padding, this.panelPadding) + 'px';
	canvas.visibility = 'hidden';
	box.display = canvas.display = '';
	if (this.shadowType === 'none') {
		this.shadowSize = 0;
	} else {
		var shadowTop = this.fbShadowTop.style,
			shadowRight = this.fbShadowRight.style,
			shadowBottom = this.fbShadowBottom.style,
			shadowLeft = this.fbShadowLeft.style,
			shadowCorner = this.fbShadowCorner.style;
		shadowRight.top = shadowBottom.left = shadowLeft.top = -this.outerBorder + 'px';
		shadowRight.paddingRight = shadowBottom.paddingBottom =
		shadowCorner.paddingRight = shadowCorner.paddingBottom = (this.outerBorder + this.shadowSize) + 'px';
		if (this.shadowType === 'halo') {
			shadowTop.paddingRight = shadowRight.paddingBottom =
			shadowBottom.paddingRight = shadowLeft.paddingBottom = (this.outerBorder*2 + this.shadowSize) + 'px';
			shadowTop.top = shadowTop.left = shadowRight.top = shadowLeft.left = -(this.outerBorder + this.shadowSize) + 'px';
		} else {
			shadowBottom.backgroundPosition = 'bottom left';
			shadowRight.paddingBottom = shadowBottom.paddingRight = this.outerBorder*2 + 'px';
		}
	}
	if (this.navOverlay) {
		if (fb.showNavOverlay === 'never' || (fb.showNavOverlay === 'once' && fb.navOverlayShown)) {
			fb.showNavOverlay = false;
		} else {
			this.fbOverlayPrev.style.backgroundPosition = this.fbOverlayNext.style.backgroundPosition = this.onPos;
			this.fadeOpacity(this.fbOverlayPrev, this.controlOpacity);
			this.fadeOpacity(this.fbOverlayNext, this.controlOpacity);
		}
	}
	this.initPanels();
	this.lastShown = false;
	if (this.hideFlash) this.hideElements('flash');
	if (this.hideJava) this.hideElements('applet');
	if (this.ieOld) {
		this.hideElements('select');
		this.fbOverlay.style.position = 'absolute';
		this.stretchOverlay()();
		attachEvent('onresize', this.stretchOverlay());
		attachEvent('onscroll', this.stretchOverlay());
	}
},
hideElements: function(type, thisWindow) {
	if (!thisWindow) {
		this.hideElements(type, self);
	} else {
		var tagName, tagNames = type === 'flash' ? ['object', 'embed'] : [type];
		try {
			while ((tagName = tagNames.pop())) {
				var els = thisWindow.document.getElementsByTagName(tagName),
					i = els.length;
				while (i--) {
					var el = els[i];
					if (el.style.visibility !== 'hidden' && (tagName !== 'object' ||
					(el.getAttribute('type') && el.getAttribute('type').toLowerCase() === 'application/x-shockwave-flash') ||
					(el.getAttribute('classid') && el.getAttribute('classid').toLowerCase() === 'clsid:d27cdb6e-ae6d-11cf-96b8-444553540000') ||
					/data\s*=\s*"?[^>"]+\.swf\b/i.test(el.innerHTML) ||
					/param\s+name\s*=\s*"?(movie|src)("|\s)[^>]+\.swf\b/i.test(el.innerHTML))) {
						this.hiddenEls.push(el);
						el.style.visibility = 'hidden';
					}
				}
			}
		} catch(e) {}
		var iframes = thisWindow.frames, i = iframes.length;
		while (i--) {
			try {
				if (typeof iframes[i].window === 'object') this.hideElements(type, iframes[i].window);
			} catch(e) {}
		}
	}
},
getAnchorPos: function(anchor, useThumb) {
	var display = this.getDisplaySize(),
		scroll = this.getScroll(),
		noAnchorPos = { left: display.width/2 + scroll.left, top: display.height/3 + scroll.top, width: 0, height: 0 };
	var thumb = useThumb ? this.getThumb(anchor) : false;
	if (thumb && this.zoomImageStart) {
		var pos = this.getLeftTop(thumb),
			border = (thumb.offsetWidth - thumb.width)/2;
		pos.left += border;
		pos.top += border;
		pos.width = thumb.width;
		pos.height = thumb.height;
		pos.src = thumb.src;
	} else if (this.startAtClick && anchor && anchor.offsetWidth && anchor.tagName.toLowerCase() === 'a') {
		var pos = this.getLayout(thumb || anchor);
	} else {
		return noAnchorPos;
	}
	var centerPos = { left: pos.left + pos.width/2, top: pos.top + pos.height/2, width: 0, height: 0 };
	if (centerPos.left < scroll.left || centerPos.left > (scroll.left + display.width) ||
	centerPos.top < scroll.top || centerPos.top > (scroll.top + display.height)) {
		return noAnchorPos;
	}
	return (thumb && this.zoomImageStart ? pos : centerPos);
},
getThumb: function(anchor) {
	var nodes = anchor && anchor.childNodes, i = (nodes && nodes.length) || 0;
	while (i--) {
		if ((nodes[i].tagName || '').toLowerCase() === 'img') return nodes[i];
	}
	return false;
},
initPanels: function() {
	var infoPanel = this.fbInfoPanel.style,
		infoLink = this.fbInfoLink.style,
		printLink = this.fbPrintLink.style,
		itemNumber = this.fbItemNumber.style;
	if (this.infoCenter) {
		var infoPos = ' posCenter';
		infoPanel.textAlign = 'center';
		infoLink.paddingLeft = printLink.paddingLeft = itemNumber.paddingLeft =
		infoLink.paddingRight = printLink.paddingRight = itemNumber.paddingRight = (this.infoLinkGap/2) + 'px';
	} else if (this.infoLeft) {
		var infoPos = ' posLeft';
		infoPanel.textAlign = 'left';
		infoLink.paddingRight = printLink.paddingRight = this.infoLinkGap + 'px';
	} else {
		var infoPos = ' posRight';
		infoPanel.textAlign = 'right';
		infoLink.paddingLeft = printLink.paddingLeft = this.infoLinkGap + 'px';
	}
	this.fbInfoPanel.className += infoPos;
	this.fbInfoDiv.className += infoPos;
	infoPanel.width = '400px';
	var controlPanel = this.fbControlPanel.style,
		controls = this.fbControls.style,
		subControls = this.fbSubControls.style;
	if (this.controlLeft) {
		var controlPos = ' posLeft';
		controlPanel.textAlign = 'left';
	} else {
		var controlPos = ' posRight';
		controlPanel.textAlign = 'right';
		controls.right = '0';
	}
	this.fbControlPanel.className += controlPos;
	this.fbSubControls.className += controlPos;
	if (!this.ieOld) this.fbControls.className += controlPos;
	if (this.navButton) {
		var prev = this.fbPrev.style,
			next = this.fbNext.style,
			navControls = this.fbNavControls.style;
		prev.backgroundPosition = next.backgroundPosition = this.offPos;
		navControls['padding' + (this.controlLeft ? 'Left' : 'Right')] = this.controlSpacing + 'px';
		this.fbNavControls.className += controlPos;
		controlPanel.display = navControls.display = prev.display = next.display = '';
	}
	var width = 0;
	if (this.showClose) {
		var close = this.fbClose.style;
		close.backgroundPosition = this.offPos;
		this.fbClose.className += controlPos;
		controlPanel.display = controls.display = subControls.display = close.display = '';
		width = this.fbClose.offsetWidth;
	}
	if (this.showPlayPause && this.isSlideshow) {
		var play = this.fbPlay.style,
			pause = this.fbPause.style,
			playPause = this.fbPlayPause.style;
		play.backgroundPosition = pause.backgroundPosition = this.offPos;
		playPause['padding' + (this.controlLeft ? 'Left' : 'Right')] = this.controlSpacing + 'px';
		this.fbPlayPause.className += controlPos;
		controlPanel.display = controls.display = subControls.display = playPause.display = play.display = pause.display = '';
		play.top = this.isPaused ? '' : '-9999px';
		pause.top = this.isPaused ? '-9999px' : '';
		width += this.fbPlayPause.offsetWidth;
	}
	subControls.width = width + 'px';
	controlPanel.width = controls.width = (width + this.fbNavControls.offsetWidth) + 'px';
	if (this.lclNumIndexLinks) {
		var indexLinks = this.fbIndexLinks.style;
		if (this.indexLinksPanel === 'info') {
			this.fbIndexLinks.className += infoPos;
			infoPanel.display = '';
			if (this.showIndexThumbs) infoPanel.overflow = 'visible';
		} else {
			this.fbIndexLinks.className += controlPos;
			controlPanel.display = '';
			if (this.showIndexThumbs) controlPanel.overflow = 'visible';
			indexLinks['padding' + (this.indexLeft ? 'Left' : 'Right')] = '2px';
		}
		indexLinks.width = '250px';
		indexLinks.display = '';
	}
},
fetchContent: function(callback, phase) {
	var that = this;
	if (!phase) {
		if (this.fbContent) {
			this.fbMainDiv.removeChild(this.fbContent);
			delete this.fbContent;
			return this.timeouts.fetch = setTimeout(function() { that.fetchContent(callback, 1); }, 10);
		}
	}
	var item = this.currentItem;
	item.nativeWidth = item.revOptions.width;
	item.nativeHeight = item.revOptions.height;
	if (item.type !== 'img') {
		item.nativeWidth = item.nativeWidth || (fb.previousAnchor && fb.previousAnchor.nativeWidth) || this.defaultWidth;
		item.nativeHeight = item.nativeHeight || (fb.previousAnchor && fb.previousAnchor.nativeHeight) || this.defaultHeight;
	}
	if (this.ieOld) this.fbMainDiv.style.backgroundColor = item.type === 'img' ? '#000' : '';
	this.itemScroll = item.revOptions.scrolling || item.revOptions.scroll || 'auto';
	if (/img|iframe/.test(item.type)) {
		this.fbContent = this.newNode(item.type, 'fbContent', this.fbMainDiv);
		if (item.type === 'img') {
			var loader = new Image();
			loader.onload = function() {
				item.nativeWidth = item.nativeWidth || loader.width;
				item.nativeHeight = item.nativeHeight || loader.height;
				that.fbContent.src = loader.src;
				if (callback) callback();
			};
			loader.onerror = function() {
				if (this.src !== that.notFoundImg) this.src = that.notFoundImg;
			};
			loader.src = item.href;
		}
	} else {
		this.fbContent = this.newNode('div', 'fbContent', this.fbMainDiv);
		this.fbContent.style.overflow = this.itemScroll === 'yes' ? 'scroll' : (this.itemScroll === 'no' ? 'hidden' : 'auto');
		if (item.type === 'inline') {
			var el = item.sourceEl.cloneNode(true);
			el.style.display = el.style.visibility = '';
			try { this.fbContent.appendChild(el); }
			catch(e) { this.setInnerHTML(this.fbContent, el.innerHTML); }
			this.tagAnchors(this.fbContent);
		} else if (item.type === 'ajax') {
			this.xhr.getResponse(item.href, function(xhr) {
				if ((xhr.status === 200 || xhr.status === 203 || xhr.status === 304) && xhr.responseText) {
					that.setInnerHTML(that.fbContent, xhr.responseText);
					that.tagAnchors(that.fbContent);
				} else {
					that.setInnerHTML(that.fbContent, '<p style="color:#000; background:#fff; margin:1em; padding:1em;">' +
					'Unable to fetch content from ' + item.href + '</p>');
				}
			});
		}
	}
	this.fbContent.style.border = '0';
	this.fbContent.style.display = '';
	if (item.type !== 'img' && callback) callback();
},
updatePanels: function() {
	var infoPanel = this.fbInfoPanel.style,
		captionDiv = this.fbCaptionDiv.style,
		caption = this.fbCaption.style,
		infoDiv = this.fbInfoDiv.style,
		infoLink = this.fbInfoLink.style,
		printLink = this.fbPrintLink.style,
		itemNumber = this.fbItemNumber.style,
		item = this.currentItem,
		str;
	infoPanel.display = captionDiv.display = caption.display = infoDiv.display = infoLink.display = printLink.display = itemNumber.display = 'none';
	if (this.showCaption) {
		str = item.revOptions.caption || item.title || '';
		if (str === 'href') {
			str = this.encodeHTML(this.currentItem.href);
		} else {
			str = this.decodeHTML(str).replace(/&/g, '&amp;');
		}
		if (this.setInnerHTML(this.fbCaption, str) && str) infoPanel.display = captionDiv.display = caption.display = '';
	}
	if (item.revOptions.info) {
		str = this.encodeHTML(this.decodeHTML(item.revOptions.info));
		var options = item.revOptions.infoOptions || '';
		if (options) options = this.encodeHTML(this.decodeHTML(options));
		str = '<a href="' + str + '" rel="floatbox" rev="' + options + '"><b>' +
		(item.revOptions.infoText || this.strings.infoText) + '</b></a>';
		if (this.setInnerHTML(this.fbInfoLink, str)) infoPanel.display = infoDiv.display = infoLink.display = '';
	}
	if (item.revOptions.showPrint) {
		var css = item.revOptions.printCSS || '';
		str = '<a href="' + this.encodeHTML(this.currentItem.href) +
		'" onclick="fb.printContents(null, \'' + css + '\'); if (window.event) event.returnValue = false; return false;"><b>' +
		(item.revOptions.printText || this.strings.printText) + '</b></a>';
		if (this.setInnerHTML(this.fbPrintLink, str)) infoPanel.display = infoDiv.display = printLink.display = '';
	}
	if (this.lclShowItemNumber) {
		str = this.justImages ? this.strings.imgCount : (this.hasImages ? this.strings.mixedCount : this.strings.nonImgCount);
		str = str.replace('%1', this.currentIndex + 1);
		str = str.replace('%2', this.itemCount);
		if (this.setInnerHTML(this.fbItemNumber, str)) infoPanel.display = infoDiv.display = itemNumber.display = '';
	}
	var w = this.fbInfoLink.offsetWidth + this.fbPrintLink.offsetWidth + this.fbItemNumber.offsetWidth;
	if (this.ie) {
		if (this.fbInfoLink.offsetWidth) w += this.infoLinkGap;
		if (this.fbPrintLink.offsetWidth) w += this.infoLinkGap;
		if (this.fbItemNumber.offsetWidth) w += this.infoLinkGap;
	}
	infoDiv.width = w + 'px';
	if (this.lclNumIndexLinks) {
		str = '';
		var max = this.itemCount - 1,
			loRange, hiRange;
		if (this.lclNumIndexLinks === -1) {
			loRange = 0;
			hiRange = max;
		} else {
			var range = Math.floor(this.lclNumIndexLinks/2) - 1;
			loRange = this.currentIndex - range;
			hiRange = this.currentIndex + range;
			if (loRange <= 0) hiRange += Math.min(1 - loRange, range);
			if (this.currentIndex === 0) hiRange++;
			if (hiRange - max >= 0) loRange -= Math.min(1 + hiRange - max, range);
			if (this.currentIndex === max) loRange--;
		}
		var pos = this.indexTop ? 'down' : 'up',
			i = 0;
		while (i < this.itemCount) {
			if (i !== 0 && i < loRange) {
				str += '... ';
				i = loRange;
			} else if (i !== max && i > hiRange) {
				str += '... ';
				i = max;
			} else {
				if (i !== this.currentIndex) {
					var item = this.items[i];
					str += '<a class="fbPop' + pos + '" rel="nofloatbox" href="' + item.href +
					'" onclick="fb.newContent(' + i + '); if (window.event) event.returnValue = false; return false;">' + ++i;
					try {
						if (this.showIndexThumbs && item.thumb) {
							str += '<img src="' + item.thumb.src + '" />';
						}
					} catch(e) {}
					str += '</a> ';
				} else {
					str += ++i + ' ';
				}
			}
		}
		if (this.setInnerHTML(this.fbIndexLinks, str)) {
			if (this.indexLinksPanel === 'info') {
				infoPanel.display = '';
			} else {
				this.tagAnchors(this.fbIndexLinks);
			}
		}
	}
	if (!infoPanel.display) this.tagAnchors(this.fbInfoPanel);
},
calcSize: function(fit, pass) {
	var that = this;
	if (!this.fbBox) return;
	var boxX, boxY, boxW, boxH, mainW, mainH ;
	if (typeof fit === 'undefined') {
		fit = this.currentItem.type === 'img' ? this.autoSizeImages : this.autoSizeOther;
	}
	var box = this.fbBox.style,
		infoPanel = this.fbInfoPanel.style,
		controlPanel = this.fbControlPanel.style,
		indexLinks = this.fbIndexLinks.style,
		captionDiv = this.fbCaptionDiv.style,
		itemNumber = this.fbItemNumber.style;
	if (!pass) {
		this.displaySize = this.getDisplaySize();
		if (this.showCaption && this.fbCaption.innerHTML) captionDiv.display = '';
		if (this.lclShowItemNumber) itemNumber.display = '';
	}
	this.upperSpace = Math.max(this.infoTop ? this.fbInfoPanel.offsetHeight : 0, this.controlTop ? this.fbControlPanel.offsetHeight : 0);
	this.lowerSpace = Math.max(this.infoTop ? 0 : this.fbInfoPanel.offsetHeight, this.controlTop ? 0 : this.fbControlPanel.offsetHeight);
	if (this.upperSpace) this.upperSpace += 2*this.panelPadding;
	if (this.lowerSpace) this.lowerSpace += 2*this.panelPadding;
	this.upperSpace = Math.max(this.upperSpace, this.padding);
	this.lowerSpace = Math.max(this.lowerSpace, this.padding);
	var extraSpace;
	if (this.shadowType === 'none') {
		extraSpace = 2*this.autoSizeSpace;
	} else if (this.shadowType === 'halo') {
		extraSpace = 2*this.shadowSize + this.autoSizeSpace;
	} else {
		extraSpace = this.shadowSize + 1.5*this.autoSizeSpace;
	}
	var pad = 2*(this.outerBorder + this.innerBorder) + extraSpace,
		maxW = Math.floor(this.displaySize.width - pad - 2*this.padding),
		maxH = Math.floor(this.displaySize.height - pad - this.upperSpace - this.lowerSpace),
		hardW = false, hardH = false;
	mainW = this.currentItem.nativeWidth + '';
	if (mainW === 'max') {
		mainW = maxW;
	} else if (mainW.substr(mainW.length - 1) === '%') {
		mainW = Math.floor(maxW * parseInt(mainW, 10) / 100);
	} else {
		mainW = parseInt(mainW, 10);
		hardW = true;
	}
	mainH = this.currentItem.nativeHeight + '';
	if (mainH === 'max') {
		mainH = maxH;
	} else if (mainH.substr(mainH.length - 1) === '%') {
		mainH = Math.floor(maxH * parseInt(mainH, 10) / 100);
	} else {
		mainH = parseInt(mainH, 10);
		hardH = true;
	}
	this.scaledBy = this.oversizedBy = 0;
	if (fit) {
		var scaleW = maxW/mainW,
			scaleH = maxH/mainH,
			fullW = mainW, fullH = mainH;
		if (hardW && hardH) scaleW = scaleH = Math.min(scaleW, scaleH);
		if (scaleW < 1) mainW = Math.round(mainW * scaleW);
		if (scaleH < 1) mainH = Math.round(mainH * scaleH);
		this.scaledBy = Math.max(fullW - mainW, fullH - mainH);
		if (this.scaledBy && this.scaledBy < this.outerBorder + extraSpace + this.panelPadding) {
			mainW = fullW;
			mainH = fullH;
			this.scaledBy = 0;
		}
	}
	boxW = mainW + 2*(this.innerBorder + this.padding);
	boxH = mainH + 2*this.innerBorder + this.upperSpace + this.lowerSpace;
	var infoH = this.fbInfoPanel.offsetHeight,
		controlH = this.fbControlPanel.offsetHeight;
	var infoW = boxW - 2*Math.max(this.padding, this.panelPadding);
	if (this.infoTop === this.controlTop && this.fbControls.offsetWidth) {
		infoW -= this.fbControls.offsetWidth + this.panelGap;
	}
	if (infoW < 0) infoW = 0;
	infoPanel.width = infoW + 'px';
	if (!this.lclNumIndexLinks) {
		var indexW = 0;
	} else if (this.indexLinksPanel === 'info' || this.infoTop !== this.controlTop) {
		var indexW = infoW;
	} else if (this.indexLinksPanel !== 'info' && this.infoTop === this.controlTop && this.infoCenter) {
		var indexW = Math.max(this.minIndexWidth, this.fbControls.offsetWidth);
	} else {
		var infoUsed = Math.max(this.fbCaption.offsetWidth, this.fbInfoLink.offsetWidth + this.fbPrintLink.offsetWidth + this.fbItemNumber.offsetWidth);
		var indexW = Math.max(this.minIndexWidth, this.fbControls.offsetWidth, (boxW - infoUsed - 2*Math.max(this.padding, this.panelPadding)));
		if (infoUsed) indexW -= this.panelGap;
	}
	if (indexW) indexLinks.width = (indexW - (this.indexLinksPanel !== 'info' ? 2 : 0)) + 'px';
	controlPanel.width = Math.max(indexW, this.fbControls.offsetWidth) + 'px';
	var changed = this.fbInfoPanel.offsetHeight !== infoH || this.fbControlPanel.offsetHeight !== controlH;
	if (this.showCaption) {
		if (this.minInfoWidth > infoW && !captionDiv.display) {
			captionDiv.display = 'none';
			changed = true;
		}
	}
	if (this.lclShowItemNumber) {
		if (this.fbInfoLink.offsetWidth + this.fbPrintLink.offsetWidth + this.fbItemNumber.offsetWidth > infoW && !itemNumber.display) {
			itemNumber.display = 'none';
			changed = true;
		}
	}
	if (changed && pass !== 3) return this.calcSize(fit, (pass || 0) + 1);
	if (!fit) this.oversizedBy = Math.max(boxW - this.displaySize.width, boxH - this.displaySize.height) + 2*this.outerBorder + extraSpace;
	if (this.oversizedBy < 0) this.oversizedBy = 0;
	if (this.shadowType === 'halo') {
		extraSpace = this.shadowSize + this.autoSizeSpace/2;
	} else {
		extraSpace = this.autoSizeSpace;
	}
	if (typeof this.boxLeft === 'number') {
		boxX = this.boxLeft;
	} else if (mainW === maxW) {
		boxX = extraSpace;
	} else {
		var freeSpace = this.displaySize.width - boxW - 2*this.outerBorder;
		boxX = Math.floor(freeSpace/2);
		if (boxX < this.autoSizeSpace) {
			boxX = this.autoSizeSpace;
		} else {
			if (typeof this.boxLeft === 'string' && this.boxLeft.substr(this.boxLeft.length - 1) === '%') {
				boxX += parseInt(this.boxLeft, 10)/100 * boxX;
			}
		}
	}
	if (typeof this.boxTop === 'number') {
		boxY = this.boxTop;
	} else if (mainH === maxH) {
		boxY = extraSpace;
	} else {
		var freeSpace = this.displaySize.height - boxH - 2*this.outerBorder,
			ratio = freeSpace / this.displaySize.height, factor;
		if (ratio <= 0.15) {
			factor = 2;
		} else if (ratio >= 0.3) {
			factor = 3;
		} else {
			factor = 1 + ratio/0.15;
		}
		boxY = Math.floor(freeSpace/factor);
		if (boxY < this.autoSizeSpace) {
			boxY = this.autoSizeSpace;
		} else {
			if (typeof this.boxTop === 'string' && this.boxTop.substr(this.boxTop.length - 1) === '%') {
				boxY += parseInt(this.boxTop, 10)/100 * boxY;
			}
		}
	}
	var boxPosition = box.position;
	if (this.ieOld) {
		box.display = 'none';
		this.stretchOverlay()();
	} else {
		this.setPosition(this.fbBox, 'fixed');
	}
	var scroll = this.getScroll();
	this.setPosition(this.fbBox, boxPosition);
	box.display = '';
	boxX += scroll.left;
	boxY += scroll.top;
	if (this.isChild) {
		var rex = /max|%/i,
			pos = this.fbParent.pos.fbBox,
			childX = rex.test(this.currentItem.nativeWidth) ? 99999 : (pos.left + boxX)/2,
			childY = rex.test(this.currentItem.nativeHeight) ? 99999 : (pos.top + boxY)/2;
		if (scroll.left < childX && scroll.top < childY) {
			boxX = Math.min(boxX, childX);
			boxY = Math.min(boxY, childY);
		}
	}
	var split = (pos = this.pos.fbBox) && !this.liveResize && this.splitResize;
	if (split === 'auto') split = boxW - pos.width <= boxH - pos.height ? 'wh' : 'hw';
	var oncomplete2 = function() {
		that.fbBox.style.visibility ? that.zoomIn() : that.showContent();
	};
	var oncomplete = function() {
		that.setSize(split,
			{ id: 'fbBox', left: boxX, top: boxY, width: boxW, height: boxH, borderWidth: that.outerBorder },
			{ id: 'fbMainDiv', width: mainW, height: mainH, top: that.upperSpace },
			function() { that.timeouts.showContent = setTimeout(oncomplete2, 10); }
		);
	};
	this.timeouts.setSize = setTimeout(oncomplete, 10);
},
setPosition: function(el, position) {
	if (el.style.position === position) return;
	var scroll = this.getScroll();
	if (position === 'fixed') {
		scroll.left = -scroll.left;
		scroll.top = -scroll.top;
	}
	if (this.pos[el.id]) {
		this.pos[el.id].left += scroll.left;
		this.pos[el.id].top += scroll.top;
	}
	el.style.left = (el.offsetLeft + scroll.left) + 'px';
	el.style.top = (el.offsetTop + scroll.top) + 'px';
	el.style.position = position;
},
collapse: function(callback, phase) {
	var that = this;
	if (!phase) {
		this.setPosition(this.fbBox, 'absolute');
		this.fbResizer.onclick = null;
		this.fbResizer.style.display = 'none';
		if (this.fbContent) {
			this.fbContent.onclick = null;
			this.fbContent.style.cursor = '';
		}
		if (this.navOverlay) {
			this.fbLeftNav.style.display = this.fbRightNav.style.display =
			this.fbOverlayPrev.style.display = this.fbOverlayNext.style.display = 'none';
		}
		var opacity = 0, duration = 0;
		if (this.currentItem.type === 'img' && !this.fbCanvas.style.visibility) {
			if (this.currentItem === this.lastShown && this.liveImageResize) opacity = 1;
			duration = this.imageFadeDuration;
		}
		this.liveResize = (opacity === 1);
		var oncomplete = function() { that.collapse(callback, 1); };
		return this.fadeOpacity(this.fbCanvas, opacity, duration, oncomplete);
	}
	if (!this.liveResize) {
		this.fbMainDiv.style.display = 'none';
		if (this.fbContent) this.fbContent.style.display = 'none';
		this.clearTimeout('loader');
		this.timeouts.loader = setTimeout(function() { that.fbLoader.style.display = ''; }, this.loaderDelay);
	}
	var infoPanel = this.fbInfoPanel.style,
		controlPanel = this.fbControlPanel.style;
	infoPanel.visibility = controlPanel.visibility = 'hidden';
	infoPanel.left = controlPanel.left = '0';
	infoPanel.top = controlPanel.top = '-9999px';
	if (callback) callback();
},
restore: function(callback, phase) {
	var that = this;
	if (!phase) {
		if (this.fbShadowRight.style.display && this.shadowType !== 'none') {
			this.fbShadowRight.style.display = this.fbShadowBottom.style.display = '';
			if (this.shadowType === 'halo') {
				this.fbShadowTop.style.display = this.fbShadowLeft.style.display = '';
			} else {
				this.fbShadowCorner.style.display = '';
			}
		}
		var infoPanel = this.fbInfoPanel.style,
			controlPanel = this.fbControlPanel.style,
			pad = this.upperSpace + this.pos.fbMainDiv.height + 2*this.innerBorder;
		infoPanel.top = (((this.infoTop ? this.upperSpace : this.lowerSpace) - this.fbInfoPanel.offsetHeight) / 2 - 1 + (this.infoTop ? 0 : pad)) + 'px';
		controlPanel.top = (((this.controlTop ? this.upperSpace : this.lowerSpace) - this.fbControlPanel.offsetHeight) / 2 + (this.controlTop ? 0 : pad)) + 'px';
		var pad = Math.max(this.padding, this.panelPadding) + 'px';
		infoPanel.left = [this.infoLeft ? pad : ''];
		controlPanel.left = [this.controlLeft ? pad : ''];
		infoPanel.visibility = controlPanel.visibility = '';
		this.clearTimeout('loader');
		this.fbLoader.style.display = 'none';
		this.fbMainDiv.style.display = this.fbContent.style.display = '';
		var duration = (this.currentItem.type === 'img' && !this.fbCanvas.style.visibility) ? this.imageFadeDuration : 0,
			oncomplete = function() { that.restore(callback, 1); };
		return this.fadeOpacity(this.fbCanvas, 1, duration, oncomplete);
	}
	if (this.currentItem.type === 'img' ? this.resizeImages : this.resizeOther) {
		var scale = 0;
		if (this.scaledBy > 35) {
			scale = 1;
		} else if (this.oversizedBy > 28){
			scale = -1;
		}
		if (scale) {
			this.fbResizer.onclick = function() {
				if (that.isSlideshow && that.pauseOnResize && !that.isPaused) {
					that.setPause(true);
				}
				that.collapse(function() { that.calcSize(scale === -1); });
				if (window.event) event.returnValue = false;
				return false;
			};
			if (this.currentItem.type === 'img' && /cursor|both/.test(this.resizeTool)) {
				this.fbContent.style.cursor = 'url(' + (scale === -1 ? this.resizeDownCursor : this.resizeUpCursor) +'), default';
				this.fbContent.onclick = this.fbResizer.onclick;
			}
			if (this.currentItem.type !== 'img' || /topleft|both/.test(this.resizeTool)) {
				this.fbResizer.style.backgroundPosition = (scale === -1 ? 'bottom' : 'top');
				this.fadeOpacity(this.fbResizer, this.controlOpacity);
			}
		}
	}
	if (this.navOverlay) {
		var leftNav = this.fbLeftNav.style,
			rightNav = this.fbRightNav.style,
			overlayPrev = this.fbOverlayPrev.style,
			overlayNext = this.fbOverlayNext.style;
		leftNav.width = rightNav.width = Math.max(this.navOverlayWidth/100 * this.pos.fbMainDiv.width, this.fbOverlayPrev.offsetWidth) + 'px';
		leftNav.display = rightNav.display = '';
		if (fb.showNavOverlay) {
			overlayPrev.visibility = overlayNext.visibility = 'hidden';
			overlayPrev.display = overlayNext.display = '';
			overlayPrev.top = overlayNext.top = ((this.pos.fbMainDiv.height - this.fbOverlayPrev.offsetHeight) * this.navOverlayPos/100) + 'px';
		}
	}
	if (callback) callback();
},
setSize: function(order) {
	var that = this,
		oncomplete = function() {},
		arr = [[], []],
		defer = {},
		node,
		i = arguments.length;
	if (order === 'wh') {
		defer.top = 1;
		defer.height = 1;
	} else if (order === 'hw') {
		defer.left = 1;
		defer.width = 1;
	}
	while (i--) {
		if (typeof arguments[i] === 'object' && (node = this[arguments[i].id])) {
			var obj = arguments[i];
			if (!this.pos[obj.id]) this.pos[obj.id] = {};
			for (var property in obj) {
				if (obj.hasOwnProperty(property) && property !== 'id') {
					var idx = defer[property] || 0;
					var start = this.pos[obj.id][property];
					if (typeof start !== 'number' || node.style.display || node.style.visibility) {
						start = obj[property];
					}
					arr[idx].push({ node: node, property: property, start: start, finish: obj[property] });
					if (obj.id === 'fbMainDiv') {
						arr[idx].push({ node: this.fbContent, property: property, start: start, finish: obj[property] });
					}
					if (obj.id === 'fbZoomDiv' && /\b(width|height)\b/i.test(property)) {
						arr[idx].push({ node: this.fbZoomImg, property: property, start: start, finish: obj[property] });
					}
					this.pos[obj.id][property] = obj[property];
				}
			}
		} else if (typeof arguments[i] === 'function') {
			oncomplete = arguments[i];
		}
	}
	this.resizeGroup(arr[0], function() { that.resizeGroup(arr[1], oncomplete); });
},
showContent: function(phase) {
	var that = this;
	if (!phase) {
		var displaySize = this.getDisplaySize();
		if (!this.resized) {
			var vscrollChanged = displaySize.width !== this.displaySize.width,
				hscrollChanged = displaySize.height !== this.displaySize.height;
			if ((vscrollChanged && Math.abs(this.pos.fbBox.width - displaySize.width) < 50) ||
			(hscrollChanged && Math.abs(this.pos.fbBox.height - displaySize.height) < 50)) {
				this.resized = true;
				return this.calcSize(this.scaledBy);
			}
		}
		this.resized = false;
		self.focus();
		if (this.ieOld) this.stretchOverlay()();
		if ((this.disableScroll || (this.ffOld && /iframe|quicktime/i.test(this.currentItem.type))) && !(this.ieOld || this.webkitOld || this.ie8b2)) {
			if (this.pos.fbBox.width <= displaySize.width && this.pos.fbBox.height <= displaySize.height) {
				this.setPosition(this.fbBox, 'fixed');
			}
		}
		if (this.currentItem.type === 'iframe') {
			this.fbContent.src = this.currentItem.href;
		} else if (/flash|quicktime/.test(this.currentItem.type)) {
			this.setInnerHTML(this.fbContent, this.objectHTML(this.currentItem.href,
			this.currentItem.type, this.pos.fbMainDiv.width, this.pos.fbMainDiv.height));
		}
		this.prevIndex = this.currentIndex ? this.currentIndex - 1 : this.itemCount - 1;
		this.nextIndex = this.currentIndex < this.itemCount - 1 ? this.currentIndex + 1 : 0;
		var prevHref = this.enableWrap || this.currentIndex !== 0 ? this.items[this.prevIndex].href : '',
			nextHref = this.enableWrap || this.currentIndex !== this.itemCount - 1 ?  this.items[this.nextIndex].href : '';
		if (this.navButton) {
			if (prevHref) {
				if (!this.operaOld) this.fbPrev.href = prevHref;
				this.fbPrev.title = this.fbOverlayPrev.title;
			} else {
				this.fbPrev.removeAttribute('href');
				this.fbPrev.title = '';
			}
			if (nextHref) {
				if (!this.operaOld) this.fbNext.href = nextHref;
				this.fbNext.title = this.fbOverlayNext.title;
			} else {
				this.fbNext.removeAttribute('href');
				this.fbNext.title = '';
			}
			var prevOn = this.fbPrev.className.replace('_off', ''),
				nextOn = this.fbNext.className.replace('_off', '');
			this.fbPrev.className = prevOn + (prevHref ? '' : '_off');
			this.fbNext.className = nextOn + (nextHref ? '' : '_off');
		}
		if (this.navOverlay) {
			if (!this.operaOld) {
				this.fbLeftNav.href = this.fbOverlayPrev.href = prevHref;
				this.fbRightNav.href = this.fbOverlayNext.href = nextHref;
			}
			this.fbLeftNav.style.visibility = prevHref ? '' : 'hidden';
			this.fbRightNav.style.visibility = nextHref ? '' : 'hidden';
			fb.navOverlayShown = true;
		}
		this.fbCanvas.style.visibility = '';
		return this.restore(function() {
			that.timeouts.showContent = setTimeout(function() { that.showContent(1); }, 10);
		} );
	}
	this.lastShown = this.currentItem;
	if (!this.currentItem.seen) {
		this.currentItem.seen = true;
		this.itemsShown++;
	}
	if (this.isSlideshow && !this.isPaused) {
		this.timeouts.slideshow = setTimeout(function() {
			if (that.endTask === 'loop' || that.itemsShown < that.itemCount) {
				that.newContent(that.nextIndex);
			} else if (that.endTask === 'exit') {
				that.end();
			} else {
				that.setPause(true);
				var i = that.itemCount;
				while (i--) that.items[i].seen = false;
				that.itemsShown = 0;
			}
		}, this.slideInterval*1000);
	}
	this.timeouts.preload = setTimeout(function() {
			that.preloadImages(nextHref || prevHref || '', true);
	}, 10);
},
objectHTML: function(href, type, width, height) {
	if (type === 'flash') {
		var classid = 'classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"',
			mime = 'type="application/x-shockwave-flash"',
			pluginurl = 'http://get.adobe.com/flashplayer/',
			match = /\bwmode=(\w+?)\b/i.exec(href),
			wmode = match ? match[1] : 'window',
			match = /\bbgcolor=(#\w+?)\b/i.exec(href),
			bgcolor = match ? match[1] : '',
			match = /\bscale=(\w+?)\b/i.exec(href),
			scale = match ? match[1] : 'exactfit',
			params = { wmode:wmode, bgcolor:bgcolor, scale:scale, quality:'high',
			flashvars:'autoplay=1&amp;ap=true&amp;border=0&amp;rel=0' };
		if (this.ffOld) params.wmode = this.ffMac ? 'window' : 'opaque';
		if (this.ffNew && href.indexOf('YV_YEP.swf') !== -1) params.wmode = 'window';
	} else {
		var classid = 'classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B"',
			mime = 'type="video/quicktime"',
			pluginurl = 'http://www.apple.com/quicktime/download/',
			params = { autoplay:'true', controller:'true', showlogo:'false', scale:'tofit' };
	}
	var html = '<object id="fbObject" name="fbObject" width="' + width + '" height="' + height + '" ';
	if (this.ie) {
		html += classid + '>';
		params[type === 'flash' ? 'movie' : 'src'] = this.encodeHTML(href);
	} else {
		html += mime + ' data="' + this.encodeHTML(href) + '">';
	}
	for (var name in params) {
		if (params.hasOwnProperty(name)) {
			html += '<param name="' + name + '" value="' + params[name] + '" />';
		}
	}
	if (type === 'quicktime' && this.webkitMac) {
		html += '<embed src="' + this.encodeHTML(href) +
		'" width="' + width + '" height="' + height + '" autoplay="true" controller="true" showlogo="false" scale="tofit" pluginspage="' +
		pluginurl + '"></embed></object>';
	} else {
		html += '<p style="color:#000; background:#fff; margin:1em; padding:1em;">' +
		(type === 'flash' ? 'Flash' : 'QuickTime') + ' player is required to view this content.' +
		'<br /><a href="' + pluginurl + '">download player</a></p></object>';
	}
	return html;
},
newContent: function(index) {
	var that = this;
	this.clearTimeout('slideshow');
	this.clearTimeout('resize');
	this.currentIndex = index;
	fb.previousAnchor = this.currentItem;
	this.currentItem = this.items[index];
	if (this.showNavOverlay == 'once' && this.navOverlayShown) this.showNavOverlay = false;
	var oncomplete = function() {
		that.updatePanels();
		that.fetchContent(function() { that.calcSize(); });
	};
	this.collapse(function() {
		that.timeouts.fetch = setTimeout(oncomplete, 10);
	} );
},
end: function(all) {
	if (this !== fb.lastChild) return fb.lastChild.end(all);
	var that = this;
	this.endAll = this.endAll || all;
	this.fbOverlay.onclick = null;
	if (this.isChild) {
		if (this.endAll) this.imageFadeDuration = this.overlayFadeDuration = this.resizeDuration = 0;
	} else {
		if (document.keydownSet) {
			document.onkeydown = this.priorOnkeydown;
			document.keydownSet = false;
		}
		if (document.keypressSet) {
			document.onkeypress = this.priorOnkeypress;
			document.keypressSet = false;
		}
		parent.focus();
	}
	if (this.ieOld) {
		detachEvent('onresize', this.stretchOverlay());
		detachEvent('onscroll', this.stretchOverlay());
	}
	for (var key in this.timeouts) {
		if (this.timeouts.hasOwnProperty(key)) this.clearTimeout(key);
	}
	if (this.fbBox.style.visibility) {
		if (!this.lastShown) this.fbZoomDiv.style.display = 'none';
	} else if (this.currentItem.type === 'img' && this.zoomImageStart) {
		if (this.currentItem.popup) this.currentItem.anchor.onmouseover();
		var anchorPos = this.getAnchorPos(this.currentItem.anchor, true);
		if (this.currentItem.popup) this.currentItem.anchor.onmouseout();
		if (anchorPos.width) {
			this.fbZoomDiv.style.borderWidth = this.zoomPopBorder + 'px';
			anchorPos.left -= this.zoomPopBorder;
			anchorPos.top -= this.zoomPopBorder;
			this.pos.thumb = anchorPos;
			return this.zoomOut();
		}
	}
	if (!this.fbBox.style.visibility) {
		var anchorPos = this.getAnchorPos(this.currentItem.anchor, !this.currentItem.popup),
			offset = this.initialSize/2,
			initialPos = { id: 'fbBox', left: anchorPos.left - offset, top: anchorPos.top - offset, width: this.initialSize, height: this.initialSize },
			zeroPos = { id: 'fbBox', left: anchorPos.left, top: anchorPos.top, width: 0, height: 0, borderWidth: 0 },
			split = this.splitResize;
		if (split === 'wh') {
			split = 'hw';
		} else if (split === 'hw') {
			split = 'wh';
		} else if (split === 'auto') {
			split = this.pos.fbBox.width <= this.pos.fbBox.height ? 'hw' : 'wh';
		}
		var oncomplete3 = function() {
			setTimeout(function() {
				that.fbBox.style.visibility = 'hidden';
				that.end();
			}, 10);
		};
		if (split) {
			var oncomplete2 = function() {
				that.setSize(split, initialPos, function() {
					that.setSize(zeroPos, oncomplete3);
				});
			};
		} else {
			var oncomplete2 = function() {
				that.setSize(zeroPos, oncomplete3);
			};
		}
		var oncomplete = function() {
			if (that.fbContent) {
				that.fbMainDiv.removeChild(that.fbContent);
				delete that.fbContent;
			}
			that.fbLoader.style.display = '';
			that.fbCanvas.style.display = that.fbShadowTop.style.display = that.fbShadowRight.style.display =
			that.fbShadowBottom.style.display = that.fbShadowLeft.style.display = that.fbShadowCorner.style.display = 'none';
			oncomplete2();
		};
		return this.collapse(oncomplete);
	}
	this.fbBox.style.display = 'none';
	var level = this.children.length + 1,
		i = this.anchors.length;
	while(i && this.anchors[i-1].level >= level) i--;
	this.anchors.length = i;
	if (this.isChild) this.children.length--;
	fb.lastChild = this.children[this.children.length-1] || fb;
	var oncomplete2 = function() {
		setTimeout(function() {
			while (that.nodeNames.length) {
				var id = that.nodeNames.pop();
				if (that[id] && that[id].parentNode) {
					that[id].parentNode.removeChild(that[id]);
					delete that[id];
				}
			}
			if (that.endAll && that.isChild) {
				return fb.end(true);
			} else if (that.loadPageOnClose) {
				if (that.loadPageOnClose === 'self' || that.loadPageOnClose === 'this') {
					location.reload(true);
				} else if (that.loadPageOnClose === 'back') {
					history.back();
				} else {
					location.replace(that.loadPageOnClose);
				}
			}
		}, 10);
	};
	var oncomplete = function() {
		while(that.hiddenEls.length) {
			var el = that.hiddenEls.pop();
			el.style.visibility = 'visible';
			if (this.ffOld && this.ffMac) {
				el.focus();
				el.blur();
			}
		}
		var overlay = that.fbOverlay.style;
		overlay.display = 'none';
		overlay.width = overlay.height = '0';
		var duration = that.currentItem.popup ? 6.5 : 0;
		that.fbZoomDiv.style.opacity = '1';
		that.fadeOpacity( that.fbZoomDiv, 0, duration, oncomplete2);
		that.currentItem = fb.previousAnchor = null;
	};
	this.fadeOpacity(this.fbOverlay, 0, this.overlayFadeDuration, oncomplete);
},
zoomIn: function(phase) {
	var that = this,
		zoomDiv = this.fbZoomDiv.style;
	if (!phase) {
		this.clearTimeout('slowLoad');
		zoomDiv.display = this.fbZoomImg.style.display = '';
		if (this.currentItem.popup) this.currentItem.anchor.onmouseout();
		var pad = this.outerBorder + this.innerBorder - this.zoomPopBorder;
		var oncomplete = function () {
			that.fbZoomImg.src = that.currentItem.href;
			that.setSize(
				{ id: 'fbZoomDiv', width: that.pos.fbMainDiv.width, height: that.pos.fbMainDiv.height,
				left: that.pos.fbBox.left + pad + that.padding, top: that.pos.fbBox.top + pad + that.upperSpace },
				function() { that.zoomIn(1); } );
		};
		return this.fadeOpacity(this.fbOverlay, this.overlayOpacity, this.overlayFadeDuration, oncomplete);
	}
	if (phase === 1) {
		var boxPos = {
			left: this.pos.fbBox.left, top: this.pos.fbBox.top,
			width: this.pos.fbBox.width, height: this.pos.fbBox.height
		};
		var pad = 2*(this.zoomPopBorder - this.outerBorder);
		this.pos.fbBox = {
			left: this.pos.fbZoomDiv.left, top: this.pos.fbZoomDiv.top,
			width: this.pos.fbZoomDiv.width + pad, height: this.pos.fbZoomDiv.height + pad
		};
		this.fbBox.style.visibility = '';
		var oncomplete = function() {
			that.restore(function() { that.zoomIn(2); });
		};
		return this.setSize(
			{ id: 'fbBox', left: boxPos.left, top: boxPos.top,
			width: boxPos.width, height: boxPos.height},
			oncomplete);
	}
	var show = function() {
		zoomDiv.display = 'none';
		that.fbZoomImg.src = '';
		zoomDiv.left = zoomDiv.top = zoomDiv.width = zoomDiv.height = that.fbZoomImg.width = that.fbZoomImg.height = '0';
		that.showContent();
	};
	this.timeouts.showContent = setTimeout(show, 10);
},
zoomOut: function(phase) {
	var that = this;
	if (!phase) {
		this.fbZoomImg.src = this.currentItem.href;
		var pad = this.outerBorder + this.innerBorder - this.zoomPopBorder;
		this.setSize(
		{ id: 'fbZoomDiv', width: this.pos.fbMainDiv.width, height: this.pos.fbMainDiv.height,
		left: this.pos.fbBox.left + pad + this.padding, top: this.pos.fbBox.top + pad + this.upperSpace },
		function() { that.zoomOut(1); } );
	}
	if (phase === 1) {
		this.fbZoomDiv.style.display = this.fbZoomImg.style.display = '';
		this.fbCanvas.style.visibility = 'hidden';
		return this.collapse(function() { that.zoomOut(2); });
	}
	if (phase === 2) {
		var pad = 2*(this.zoomPopBorder - this.outerBorder);
		return this.setSize(
			{ id: 'fbBox', left: this.pos.fbZoomDiv.left, top: this.pos.fbZoomDiv.top,
			width: this.pos.fbZoomDiv.width + pad, height: this.pos.fbZoomDiv.height + pad },
			function() { that.zoomOut(3); }
		);
	}
	this.fbBox.style.visibility = 'hidden';
	var end = function() {
		that.fbZoomImg.src = that.pos.thumb.src;
		that.end();
	};
	this.setSize(
		{ id: 'fbZoomDiv', left: this.pos.thumb.left, top: this.pos.thumb.top,
		width: this.pos.thumb.width, height: this.pos.thumb.height },
		end);
},
setPause: function(pause) {
	this.isPaused = pause;
	if (pause) {
		this.clearTimeout('slideshow');
	} else {
		this.newContent(this.nextIndex);
	}
	if (this.showPlayPause) {
		this.fbPlay.style.top = pause ? '' : '-9999px';
		this.fbPause.style.top = pause ? '-9999px' : '';
	}
},
fadeOpacity: function(el, opacity, duration, callback) {
	var startOp = +(el.style.opacity || 0);
	duration = duration || 0;
	this.clearTimeout['fade' + el.id];
	var fadeIn = (startOp <= opacity && opacity > 0);
	if (duration > 10) duration = 10;
	if (duration < 0) duration = 0;
	if (duration === 0) {
		startOp = opacity;
		var incr = 1;
	} else {
		var root = Math.pow(100, 0.1),
			power = duration + ((10 - duration)/9) * (Math.log(2)/Math.log(root) - 1),
			incr = 1/Math.pow(root, power);
	}
	if (fadeIn) {
		el.style.display = el.style.visibility = '';
	} else {
		incr = -incr;
	}
	this.stepFade(el, startOp, opacity, incr, fadeIn, callback);
},
stepFade: function(el, thisOp, finishOp, incr, fadeIn, callback) {
	if (!el) return;
	var that = this;
	if ((fadeIn && thisOp >= finishOp) || (!fadeIn && thisOp <= finishOp)) thisOp = finishOp;
	if (this.ie) el.style.filter = 'alpha(opacity=' + thisOp*100 + ')';
	el.style.opacity = thisOp + '';
	if (thisOp === finishOp) {
		if (this.ie && finishOp >= 1) el.style.removeAttribute('filter');
		if (callback) callback();
	} else {
		this.timeouts['fade' + el.id] = setTimeout(function() { that.stepFade(el, thisOp + incr, finishOp, incr, fadeIn, callback); }, 20);
	}
},
resizeGroup: function(arr, callback) {
	var i = arr.length;
	if (!i) return callback ? callback() : null;
	this.clearTimeout('resize');
	var diff = 0;
	while (i--) {
		diff = Math.max(diff, Math.abs(arr[i].finish - arr[i].start));
	}
	var duration = this.resizeDuration * (this.liveResize ? 0.65 : 1);
	var rate = diff && duration ? Math.pow(Math.max(1, 2.2 - duration/10), (Math.log(diff))) / diff : 1;
	i = arr.length;
	while (i--) arr[i].diff = arr[i].finish - arr[i].start;
	this.stepResize(rate, rate, arr, callback);
},
stepResize: function(increment, rate, arr, callback) {
	var that = this;
	if (increment > 1) increment = 1;
	var i = arr.length;
	while (i--) {
		var node = arr[i].node,
			prop = arr[i].property,
			val = Math.round(arr[i].start + arr[i].diff * increment),
			tag = node.tagName.toLowerCase();
		if (tag === 'img' || tag === 'iframe') {
			node[prop] = val;
		} else {
			node.style[prop] = val + 'px';
		}
	}
	if (increment >= 1) {
		delete this.timeouts.resize;
		if (callback) callback();
	} else {
		this.timeouts.resize = setTimeout(function() { that.stepResize(increment + rate, rate, arr, callback); }, 20);
	}
},
getDisplaySize: function() {
	return { width: this.getDisplayWidth(), height: this.getDisplayHeight() };
},
getDisplayWidth: function() {
	return this.html.clientWidth || this.bod.clientWidth;
},
getDisplayHeight: function() {
	if (this.webkitOld) return window.innerHeight;
	if (!this.html.clientHeight || this.operaOld || document.compatMode === 'BackCompat') {
		return this.bod.clientHeight;
	}
	return this.html.clientHeight;
},
getScroll: function(win) {
	if (!(win && win.document)) win = self;
	var doc = win.document,
		html = doc.documentElement,
		bod = doc.body || doc.getElementsByTagName('body')[0],
		left = win.pageXOffset || bod.scrollLeft || doc.documentElement.scrollLeft || 0;
	if (this.ie && this.rtl) left -= html.scrollWidth - html.clientWidth;
	return {
		left: left,
		top: win.pageYOffset || bod.scrollTop || doc.documentElement.scrollTop || 0
	};
},
getLeftTop: function(el, local) {
	var left = el.offsetLeft || 0,
		top = el.offsetTop || 0,
		doc = el.ownerDocument || el.document,
		bod = doc.body || doc.getElementsByTagName('body')[0],
		win = doc.defaultView || doc.parentWindow || doc.contentWindow,
		scroll = this.getScroll(win),
		position = this.getStyle(el, 'position', win),
		rex = /absolute|fixed/,
		elFlow = !rex.test(position),
		inFlow = elFlow,
		node = el;
	if (position === 'fixed') {
		left += scroll.left;
		top += scroll.top;
	}
	while (position !== 'fixed' && (node = node.offsetParent)) {
		var borderLeft = 0,
			borderTop = 0,
			nodeFlow = true,
			position = this.getStyle(node, 'position', win),
			nodeFlow = !rex.test(position);
		if (this.opera) {
			if (local && node !== bod) {
				left += node.scrollLeft - node.clientLeft;
				top += node.scrollTop - node.clientTop;
			}
		} else if (this.ie) {
			if (node.currentStyle.hasLayout && node !== doc.documentElement) {
				borderLeft = node.clientLeft;
				borderTop = node.clientTop;
			}
		} else {
			borderLeft = parseInt(this.getStyle(node, 'border-left-width', win), 10);
			borderTop = parseInt(this.getStyle(node, 'border-top-width', win), 10);
			if (this.ff && node === el.offsetParent && !nodeFlow && (this.ffOld || !elFlow)) {
				left += borderLeft;
				top += borderTop;
			}
		}
		if (!nodeFlow) {
			if (local) return { left: left, top: top };
			inFlow = false;
		}
		if (node.offsetLeft > 0) left += node.offsetLeft;
		left += borderLeft;
		top += node.offsetTop + borderTop;
		if (position === 'fixed') {
			left += scroll.left;
			top += scroll.top;
		}
		if (!(this.opera && elFlow) && node !== bod && node !== doc.documentElement) {
			left -= node.scrollLeft;
			top -= node.scrollTop;
		}
	}
	if (this.ff && inFlow) {
		left += parseInt(this.getStyle(bod, 'border-left-width', win), 10);
		top += parseInt(this.getStyle(bod, 'border-top-width', win), 10);
	}
	if (this.webkitOld) {
		var scriptElement = doc.createElement('script');
		scriptElement.innerHTML = 'document.parentWindow=self';
		doc.documentElement.appendChild(scriptElement);
		doc.documentElement.removeChild(scriptElement);
		win = doc.parentWindow;
	}
	if (!local && win !== self) {
		var iframes = win.parent.document.getElementsByTagName('iframe'),
			i = iframes.length;
		while (i--) {
			var node = iframes[i],
				idoc = false;
			try {
				idoc = node.contentDocument || node.contentWindow;
				idoc = idoc.document || idoc;
			} catch(e) {}
			if (idoc === doc || (typeof idoc !== 'object' && node.src === win.location.href.substr(win.location.href.length - node.src.length))) {
				if (this.webkitOld) win = doc.defaultView;
				var pos = this.getLeftTop(node);
				left += pos.left - scroll.left;
				top += pos.top - scroll.top;
				if (this.ie || this.opera) {
					var padLeft = 0, padTop = 0;
					if (!this.ie || elFlow) {
						padLeft = parseInt(this.getStyle(node, 'padding-left', win), 10);
						padTop = parseInt(this.getStyle(node, 'padding-top', win), 10);
					}
					left += node.clientLeft + padLeft;
					top += node.clientTop + padTop;
				} else {
					left += parseInt(this.getStyle(node, 'border-left-width', win), 10) +
					parseInt(this.getStyle(node, 'padding-left', win), 10);
					top += parseInt(this.getStyle(node, 'border-top-width', win), 10) +
					parseInt(this.getStyle(node, 'padding-top', win), 10);
				}
				break;
			}
		}
	}
	return { left: left, top: top };
},
getStyle: function(el, prop, win) {
	if (!(el && prop)) return '';
	if (!win) {
		var doc = el.ownerDocument || el.document;
		win = doc.defaultView || doc.parentWindow || doc.contentWindow;
	}
	if (el.currentStyle) {
		return el.currentStyle[prop.replace(/-(\w)/g, function(match, p1) { return p1.toUpperCase(); })] || '';
	} else {
		if (!win) {
			var doc = el.ownerDocument || el.document;
			win = doc.defaultView || doc.parentWindow || doc.contentWindow;
		}
		return (win.getComputedStyle && win.getComputedStyle(el, '').getPropertyValue(prop)) || '';
	}
},
getLayout: function(el) {
	var lay = this.getLeftTop(el);
	lay.width = el.offsetWidth;
	lay.height = el.offsetHeight;
	return lay;
},
clearTimeout: function(key) {
	if (this.timeouts[key]) {
		clearTimeout(this.timeouts[key]);
		delete this.timeouts[key];
	}
},
stretchOverlay: function() {
	var that = this;
	return function() {
		if (arguments.length === 1) {
			that.clearTimeout('stretch');
			that.timeouts.stretch = setTimeout(function() { that.stretchOverlay()(); }, 25);
		} else {
			delete that.timeouts.stretch;
			if (!that.fbBox) return;
			var width = that.fbBox.offsetLeft + that.fbBox.offsetWidth,
				height = that.fbBox.offsetTop + that.fbBox.offsetHeight,
				display = that.getDisplaySize(),
				scroll = that.getScroll(),
				overlay = that.fbOverlay.style;
			overlay.width = overlay.height = '0';
			var rtlAdjust = (that.rtl && scroll.left) ? that.html.clientWidth - that.html.scrollWidth : 0;
			overlay.left = rtlAdjust + 'px';
			overlay.width = Math.max(width, that.bod.scrollWidth, that.bod.clientWidth, that.html.clientWidth, display.width + scroll.left) + 'px';
			overlay.height = Math.max(height, that.bod.scrollHeight, that.bod.clientHeight, that.html.clientHeight, display.height + scroll.top) + 'px';
		}
	};
},
encodeHTML: function(str) {
	return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#39;');
},
decodeHTML: function(str) {
	return str.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&quot;/g, '"').replace(/&apos;/g, "'").replace(/&#39;/g, "'");
},
getXMLHttpRequest: function() {
	var xhr, that = this;
	if (window.XMLHttpRequest) {
		if (!(xhr = new XMLHttpRequest())) return false;
	} else {
		try { xhr = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) {
			try { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { return false; }
		}
	}
	return {
		getResponse: function(url, callback) {
			try {
				xhr.open('GET', url, true);
				xhr.setRequestHeader('If-Modified-Since', 'Thu, 1 Jan 1970 00:00:00 GMT');
				xhr.setRequestHeader('Cache-Control', 'no-cache');
				xhr.onreadystatechange = function() {
					if (xhr.readyState === 4) {
						xhr.onreadystatechange = function() {};
						callback(xhr);
					}
				};
				xhr.send(null);
			} catch(e) {}
		}
	};
},
setInnerHTML: function(el, strHTML) {
	try {
		var range = document.createRange();
		range.selectNodeContents(el);
		range.deleteContents();
		if (strHTML) {
			var xmlDiv = new DOMParser().parseFromString('<div xmlns="http://www.w3.org/1999/xhtml">' + strHTML + '</div>', 'application/xhtml+xml'),
				childNodes = xmlDiv.documentElement.childNodes;
			for (var i = 0, len = childNodes.length; i < len; i++) {
				el.appendChild(document.importNode(childNodes[i], true));
			}
		}
		return true;
	} catch (e) {}
	try {
		el.innerHTML = strHTML;
		return true;
	} catch(e) {}
	return false;
},
printContents: function(el, style) {
	if (el && el.offsetWidth) {
		var width = el.offsetWidth,
			height = el.offsetHeight;
	} else {
		el = fb.lastChild.fbContent;
		var pos = fb.lastChild.pos.fbMainDiv,
			width = pos.width,
			height = pos.height;
	}
	var win = window.open('', '', 'width=' + width + ', height=' + height),
		doc = win && win.document;
	if (!doc) {
		alert('Popup windows are being blocked by your browser.\nUnable to print.');
		return false;
	}
	if (/\.css$/i.test(style)) {
		style = '<link rel="stylesheet" type="text/css" href="' + style + '" />';
	} else {
		style = '<style type="text/css"> html,body{border:0;margin:0;padding:0;}' + (style || '') + '</style>';
	}
	var div = document.createElement('div');
	div.appendChild(el.cloneNode(true));
	doc.open('text/html');
	doc.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"' +
	' "http://www.w3.org/TR/html4/loose.dtd"><html><head>' +
	style + '</head><body><div>' + div.innerHTML + '</div></body></html>');
	doc.close();
	setTimeout(function() { win && win.print(); win && win.close(); }, 200);
	return true;
},
loadAnchor: function(href, rev, title) {
	if (href.setAttribute) {
		var anchor = href;
		if (!anchor.getAttribute('rel')) anchor.setAttribute('rel', 'floatbox');
		fb.lastChild.start(this.tagOneAnchor(anchor));
	} else {
		fb.lastChild.start(this.tagOneAnchor({ href: href, rev: rev, title: title, rel: 'floatbox' }));
	}
},
goBack: function() {
	var a = fb.previousAnchor;
	if (a) this.loadAnchor(a.href, a.rev + ' sameBox:true', a.title);
},
resize: function(width, height) {
	var changed = false;
	if (width && fb.lastChild.currentItem && fb.lastChild.currentItem.nativeWidth != width) {
		fb.lastChild.currentItem.nativeWidth = width;
		changed = true;
	}
	if (height && fb.lastChild.currentItem && fb.lastChild.currentItem.nativeHeight != height) {
		fb.lastChild.currentItem.nativeHeight = height;
		changed = true;
	}
	if (changed) fb.lastChild.calcSize(false);
}
};
function initfb() {
	if (arguments.callee.done) return;
	var fbWindow = 'self';
	if (self !== parent) {
		try {
			if (self.location.host === parent.location.host && self.location.protocol === parent.location.protocol) fbWindow = 'parent';
		} catch(e) {}
		if (fbWindow === 'parent' && !parent.fb) return setTimeout(initfb, 50);
	}
	arguments.callee.done = true;
	if (document.compatMode === 'BackCompat') {
		alert('Floatbox does not support quirks mode.\nPage needs to have a valid a doc type.');
		return;
	}
	fb = (fbWindow === 'self' ? new Floatbox() : parent.fb);
	fb.tagAnchors(self.document.body || self.document.getElementsByTagName('body')[0]);
	if (fb.autoStart) {
		fb.start(fb.autoStart);
		if (typeof fb !== 'undefined') delete fb.autoStart;
	} else {
		fb.preloadImages('', true);
	}
}
if (document.addEventListener) {
	document.addEventListener('DOMContentLoaded', initfb, false);
}
(function() {
	/*@cc_on
	if (document.body) {
		try {
			document.createElement('div').doScroll('left');
			return initfb();
		} catch(e) {}
	}
	/*@if (false) @*/
	if (/loaded|complete/.test(document.readyState)) return initfb();
	/*@end @*/
	if (!initfb.done) setTimeout(arguments.callee, 50);
})();
fb_prevOnload = window.onload;
window.onload = function() {
	if (arguments.callee.done) return;
	arguments.callee.done = true;
	if (typeof fb_prevOnload === 'function') fb_prevOnload();
	initfb();
};

/***************************** VALIDATE ****************************/

(function($){$.extend($.fn,{validate:function(options){if(!this.length){options&&options.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return;}var validator=$.data(this[0],'validator');if(validator){return validator;}validator=new $.validator(options,this[0]);$.data(this[0],'validator',validator);if(validator.settings.onsubmit){this.find("input, button").filter(".cancel").click(function(){validator.cancelSubmit=true;});if(validator.settings.submitHandler){this.find("input, button").filter(":submit").click(function(){validator.submitButton=this;});}this.submit(function(event){if(validator.settings.debug)event.preventDefault();function handle(){if(validator.settings.submitHandler){if(validator.submitButton){var hidden=$("<input type='hidden'/>").attr("name",validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);}validator.settings.submitHandler.call(validator,validator.currentForm);if(validator.submitButton){hidden.remove();}return false;}return true;}if(validator.cancelSubmit){validator.cancelSubmit=false;return handle();}if(validator.form()){if(validator.pendingRequest){validator.formSubmitted=true;return false;}return handle();}else{validator.focusInvalid();return false;}});}return validator;},valid:function(){if($(this[0]).is('form')){return this.validate().form();}else{var valid=true;var validator=$(this[0].form).validate();this.each(function(){valid&=validator.element(this);});return valid;}},removeAttrs:function(attributes){var result={},$element=this;$.each(attributes.split(/\s/),function(index,value){result[value]=$element.attr(value);$element.removeAttr(value);});return result;},rules:function(command,argument){var element=this[0];if(command){var settings=$.data(element.form,'validator').settings;var staticRules=settings.rules;var existingRules=$.validator.staticRules(element);switch(command){case"add":$.extend(existingRules,$.validator.normalizeRule(argument));staticRules[element.name]=existingRules;if(argument.messages)settings.messages[element.name]=$.extend(settings.messages[element.name],argument.messages);break;case"remove":if(!argument){delete staticRules[element.name];return existingRules;}var filtered={};$.each(argument.split(/\s/),function(index,method){filtered[method]=existingRules[method];delete existingRules[method];});return filtered;}}var data=$.validator.normalizeRules($.extend({},$.validator.metadataRules(element),$.validator.classRules(element),$.validator.attributeRules(element),$.validator.staticRules(element)),element);if(data.required){var param=data.required;delete data.required;data=$.extend({required:param},data);}return data;}});$.extend($.expr[":"],{blank:function(a){return!$.trim(""+a.value);},filled:function(a){return!!$.trim(""+a.value);},unchecked:function(a){return!a.checked;}});$.validator=function(options,form){this.settings=$.extend(true,{},$.validator.defaults,options);this.currentForm=form;this.init();};$.validator.format=function(source,params){if(arguments.length==1)return function(){var args=$.makeArray(arguments);args.unshift(source);return $.validator.format.apply(this,args);};if(arguments.length>2&&params.constructor!=Array){params=$.makeArray(arguments).slice(1);}if(params.constructor!=Array){params=[params];}$.each(params,function(i,n){source=source.replace(new RegExp("\\{"+i+"\\}","g"),n);});return source;};$.extend($.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:true,errorContainer:$([]),errorLabelContainer:$([]),onsubmit:true,ignore:[],ignoreTitle:false,onfocusin:function(element){this.lastActive=element;if(this.settings.focusCleanup&&!this.blockFocusCleanup){this.settings.unhighlight&&this.settings.unhighlight.call(this,element,this.settings.errorClass,this.settings.validClass);this.errorsFor(element).hide();}},onfocusout:function(element){if(!this.checkable(element)&&(element.name in this.submitted||!this.optional(element))){this.element(element);}},onkeyup:function(element){if(element.name in this.submitted||element==this.lastElement){this.element(element);}},onclick:function(element){if(element.name in this.submitted)this.element(element);else if(element.parentNode.name in this.submitted)this.element(element.parentNode);},highlight:function(element,errorClass,validClass){$(element).addClass(errorClass).removeClass(validClass);},unhighlight:function(element,errorClass,validClass){$(element).removeClass(errorClass).addClass(validClass);}},setDefaults:function(settings){$.extend($.validator.defaults,settings);},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",accept:"Please enter a value with a valid extension.",maxlength:$.validator.format("Please enter no more than {0} characters."),minlength:$.validator.format("Please enter at least {0} characters."),rangelength:$.validator.format("Please enter a value between {0} and {1} characters long."),range:$.validator.format("Please enter a value between {0} and {1}."),max:$.validator.format("Please enter a value less than or equal to {0}."),min:$.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:false,prototype:{init:function(){this.labelContainer=$(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||$(this.currentForm);this.containers=$(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();var groups=(this.groups={});$.each(this.settings.groups,function(key,value){$.each(value.split(/\s/),function(index,name){groups[name]=key;});});var rules=this.settings.rules;$.each(rules,function(key,value){rules[key]=$.validator.normalizeRule(value);});function delegate(event){var validator=$.data(this[0].form,"validator"),eventType="on"+event.type.replace(/^validate/,"");validator.settings[eventType]&&validator.settings[eventType].call(validator,this[0]);}$(this.currentForm).validateDelegate(":text, :password, :file, select, textarea","focusin focusout keyup",delegate).validateDelegate(":radio, :checkbox, select, option","click",delegate);if(this.settings.invalidHandler)$(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler);},form:function(){this.checkForm();$.extend(this.submitted,this.errorMap);this.invalid=$.extend({},this.errorMap);if(!this.valid())$(this.currentForm).triggerHandler("invalid-form",[this]);this.showErrors();return this.valid();},checkForm:function(){this.prepareForm();for(var i=0,elements=(this.currentElements=this.elements());elements[i];i++){this.check(elements[i]);}return this.valid();},element:function(element){element=this.clean(element);this.lastElement=element;this.prepareElement(element);this.currentElements=$(element);var result=this.check(element);if(result){delete this.invalid[element.name];}else{this.invalid[element.name]=true;}if(!this.numberOfInvalids()){this.toHide=this.toHide.add(this.containers);}this.showErrors();return result;},showErrors:function(errors){if(errors){$.extend(this.errorMap,errors);this.errorList=[];for(var name in errors){this.errorList.push({message:errors[name],element:this.findByName(name)[0]});}this.successList=$.grep(this.successList,function(element){return!(element.name in errors);});}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors();},resetForm:function(){if($.fn.resetForm)$(this.currentForm).resetForm();this.submitted={};this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass);},numberOfInvalids:function(){return this.objectLength(this.invalid);},objectLength:function(obj){var count=0;for(var i in obj)count++;return count;},hideErrors:function(){this.addWrapper(this.toHide).hide();},valid:function(){return this.size()==0;},size:function(){return this.errorList.length;},focusInvalid:function(){if(this.settings.focusInvalid){try{$(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin");}catch(e){}}},findLastActive:function(){var lastActive=this.lastActive;return lastActive&&$.grep(this.errorList,function(n){return n.element.name==lastActive.name;}).length==1&&lastActive;},elements:function(){var validator=this,rulesCache={};return $([]).add(this.currentForm.elements).filter(":input").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){!this.name&&validator.settings.debug&&window.console&&console.error("%o has no name assigned",this);if(this.name in rulesCache||!validator.objectLength($(this).rules()))return false;rulesCache[this.name]=true;return true;});},clean:function(selector){return $(selector)[0];},errors:function(){return $(this.settings.errorElement+"."+this.settings.errorClass,this.errorContext);},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=$([]);this.toHide=$([]);this.currentElements=$([]);},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers);},prepareElement:function(element){this.reset();this.toHide=this.errorsFor(element);},check:function(element){element=this.clean(element);if(this.checkable(element)){element=this.findByName(element.name)[0];}var rules=$(element).rules();var dependencyMismatch=false;for(method in rules){var rule={method:method,parameters:rules[method]};try{var result=$.validator.methods[method].call(this,element.value.replace(/\r/g,""),element,rule.parameters);if(result=="dependency-mismatch"){dependencyMismatch=true;continue;}dependencyMismatch=false;if(result=="pending"){this.toHide=this.toHide.not(this.errorsFor(element));return;}if(!result){this.formatAndAdd(element,rule);return false;}}catch(e){this.settings.debug&&window.console&&console.log("exception occured when checking element "+element.id
+", check the '"+rule.method+"' method",e);throw e;}}if(dependencyMismatch)return;if(this.objectLength(rules))this.successList.push(element);return true;},customMetaMessage:function(element,method){if(!$.metadata)return;var meta=this.settings.meta?$(element).metadata()[this.settings.meta]:$(element).metadata();return meta&&meta.messages&&meta.messages[method];},customMessage:function(name,method){var m=this.settings.messages[name];return m&&(m.constructor==String?m:m[method]);},findDefined:function(){for(var i=0;i<arguments.length;i++){if(arguments[i]!==undefined)return arguments[i];}return undefined;},defaultMessage:function(element,method){return this.findDefined(this.customMessage(element.name,method),this.customMetaMessage(element,method),!this.settings.ignoreTitle&&element.title||undefined,$.validator.messages[method],"<strong>Warning: No message defined for "+element.name+"</strong>");},formatAndAdd:function(element,rule){var message=this.defaultMessage(element,rule.method),theregex=/\$?\{(\d+)\}/g;if(typeof message=="function"){message=message.call(this,rule.parameters,element);}else if(theregex.test(message)){message=jQuery.format(message.replace(theregex,'{$1}'),rule.parameters);}this.errorList.push({message:message,element:element});this.errorMap[element.name]=message;this.submitted[element.name]=message;},addWrapper:function(toToggle){if(this.settings.wrapper)toToggle=toToggle.add(toToggle.parent(this.settings.wrapper));return toToggle;},defaultShowErrors:function(){for(var i=0;this.errorList[i];i++){var error=this.errorList[i];this.settings.highlight&&this.settings.highlight.call(this,error.element,this.settings.errorClass,this.settings.validClass);this.showLabel(error.element,error.message);}if(this.errorList.length){this.toShow=this.toShow.add(this.containers);}if(this.settings.success){for(var i=0;this.successList[i];i++){this.showLabel(this.successList[i]);}}if(this.settings.unhighlight){for(var i=0,elements=this.validElements();elements[i];i++){this.settings.unhighlight.call(this,elements[i],this.settings.errorClass,this.settings.validClass);}}this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show();},validElements:function(){return this.currentElements.not(this.invalidElements());},invalidElements:function(){return $(this.errorList).map(function(){return this.element;});},showLabel:function(element,message){var label=this.errorsFor(element);if(label.length){label.removeClass().addClass(this.settings.errorClass);label.attr("generated")&&label.html(message);}else{label=$("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(element),generated:true}).addClass(this.settings.errorClass).html(message||"");if(this.settings.wrapper){label=label.hide().show().wrap("<"+this.settings.wrapper+"/>").parent();}if(!this.labelContainer.append(label).length)this.settings.errorPlacement?this.settings.errorPlacement(label,$(element)):label.insertAfter(element);}if(!message&&this.settings.success){label.text("");typeof this.settings.success=="string"?label.addClass(this.settings.success):this.settings.success(label);}this.toShow=this.toShow.add(label);},errorsFor:function(element){var name=this.idOrName(element);return this.errors().filter(function(){return $(this).attr('for')==name;});},idOrName:function(element){return this.groups[element.name]||(this.checkable(element)?element.name:element.id||element.name);},checkable:function(element){return/radio|checkbox/i.test(element.type);},findByName:function(name){var form=this.currentForm;return $(document.getElementsByName(name)).map(function(index,element){return element.form==form&&element.name==name&&element||null;});},getLength:function(value,element){switch(element.nodeName.toLowerCase()){case'select':return $("option:selected",element).length;case'input':if(this.checkable(element))return this.findByName(element.name).filter(':checked').length;}return value.length;},depend:function(param,element){return this.dependTypes[typeof param]?this.dependTypes[typeof param](param,element):true;},dependTypes:{"boolean":function(param,element){return param;},"string":function(param,element){return!!$(param,element.form).length;},"function":function(param,element){return param(element);}},optional:function(element){return!$.validator.methods.required.call(this,$.trim(element.value),element)&&"dependency-mismatch";},startRequest:function(element){if(!this.pending[element.name]){this.pendingRequest++;this.pending[element.name]=true;}},stopRequest:function(element,valid){this.pendingRequest--;if(this.pendingRequest<0)this.pendingRequest=0;delete this.pending[element.name];if(valid&&this.pendingRequest==0&&this.formSubmitted&&this.form()){$(this.currentForm).submit();this.formSubmitted=false;}else if(!valid&&this.pendingRequest==0&&this.formSubmitted){$(this.currentForm).triggerHandler("invalid-form",[this]);this.formSubmitted=false;}},previousValue:function(element){return $.data(element,"previousValue")||$.data(element,"previousValue",{old:null,valid:true,message:this.defaultMessage(element,"remote")});}},classRuleSettings:{required:{required:true},email:{email:true},url:{url:true},date:{date:true},dateISO:{dateISO:true},dateDE:{dateDE:true},number:{number:true},numberDE:{numberDE:true},digits:{digits:true},creditcard:{creditcard:true}},addClassRules:function(className,rules){className.constructor==String?this.classRuleSettings[className]=rules:$.extend(this.classRuleSettings,className);},classRules:function(element){var rules={};var classes=$(element).attr('class');classes&&$.each(classes.split(' '),function(){if(this in $.validator.classRuleSettings){$.extend(rules,$.validator.classRuleSettings[this]);}});return rules;},attributeRules:function(element){var rules={};var $element=$(element);for(method in $.validator.methods){var value=$element.attr(method);if(value){rules[method]=value;}}if(rules.maxlength&&/-1|2147483647|524288/.test(rules.maxlength)){delete rules.maxlength;}return rules;},metadataRules:function(element){if(!$.metadata)return{};var meta=$.data(element.form,'validator').settings.meta;return meta?$(element).metadata()[meta]:$(element).metadata();},staticRules:function(element){var rules={};var validator=$.data(element.form,'validator');if(validator.settings.rules){rules=$.validator.normalizeRule(validator.settings.rules[element.name])||{};}return rules;},normalizeRules:function(rules,element){$.each(rules,function(prop,val){if(val===false){delete rules[prop];return;}if(val.param||val.depends){var keepRule=true;switch(typeof val.depends){case"string":keepRule=!!$(val.depends,element.form).length;break;case"function":keepRule=val.depends.call(element,element);break;}if(keepRule){rules[prop]=val.param!==undefined?val.param:true;}else{delete rules[prop];}}});$.each(rules,function(rule,parameter){rules[rule]=$.isFunction(parameter)?parameter(element):parameter;});$.each(['minlength','maxlength','min','max'],function(){if(rules[this]){rules[this]=Number(rules[this]);}});$.each(['rangelength','range'],function(){if(rules[this]){rules[this]=[Number(rules[this][0]),Number(rules[this][1])];}});if($.validator.autoCreateRanges){if(rules.min&&rules.max){rules.range=[rules.min,rules.max];delete rules.min;delete rules.max;}if(rules.minlength&&rules.maxlength){rules.rangelength=[rules.minlength,rules.maxlength];delete rules.minlength;delete rules.maxlength;}}if(rules.messages){delete rules.messages;}return rules;},normalizeRule:function(data){if(typeof data=="string"){var transformed={};$.each(data.split(/\s/),function(){transformed[this]=true;});data=transformed;}return data;},addMethod:function(name,method,message){$.validator.methods[name]=method;$.validator.messages[name]=message!=undefined?message:$.validator.messages[name];if(method.length<3){$.validator.addClassRules(name,$.validator.normalizeRule(name));}},methods:{required:function(value,element,param){if(!this.depend(param,element))return"dependency-mismatch";switch(element.nodeName.toLowerCase()){case'select':var val=$(element).val();return val&&val.length>0;case'input':if(this.checkable(element))return this.getLength(value,element)>0;default:return $.trim(value).length>0;}},remote:function(value,element,param){if(this.optional(element))return"dependency-mismatch";var previous=this.previousValue(element);if(!this.settings.messages[element.name])this.settings.messages[element.name]={};previous.originalMessage=this.settings.messages[element.name].remote;this.settings.messages[element.name].remote=previous.message;param=typeof param=="string"&&{url:param}||param;if(previous.old!==value){previous.old=value;var validator=this;this.startRequest(element);var data={};data[element.name]=value;$.ajax($.extend(true,{url:param,mode:"abort",port:"validate"+element.name,dataType:"json",data:data,success:function(response){validator.settings.messages[element.name].remote=previous.originalMessage;var valid=response===true;if(valid){var submitted=validator.formSubmitted;validator.prepareElement(element);validator.formSubmitted=submitted;validator.successList.push(element);validator.showErrors();}else{var errors={};var message=(previous.message=response||validator.defaultMessage(element,"remote"));errors[element.name]=$.isFunction(message)?message(value):message;validator.showErrors(errors);}previous.valid=valid;validator.stopRequest(element,valid);}},param));return"pending";}else if(this.pending[element.name]){return"pending";}return previous.valid;},minlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)>=param;},maxlength:function(value,element,param){return this.optional(element)||this.getLength($.trim(value),element)<=param;},rangelength:function(value,element,param){var length=this.getLength($.trim(value),element);return this.optional(element)||(length>=param[0]&&length<=param[1]);},min:function(value,element,param){return this.optional(element)||value>=param;},max:function(value,element,param){return this.optional(element)||value<=param;},range:function(value,element,param){return this.optional(element)||(value>=param[0]&&value<=param[1]);},email:function(value,element){return this.optional(element)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);},url:function(value,element){return this.optional(element)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);},date:function(value,element){return this.optional(element)||!/Invalid|NaN/.test(new Date(value));},dateISO:function(value,element){return this.optional(element)||/^\d{4}[\/-]\d{1,2}[\/-]\d{1,2}$/.test(value);},number:function(value,element){return this.optional(element)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?$/.test(value);},digits:function(value,element){return this.optional(element)||/^\d+$/.test(value);},creditcard:function(value,element){if(this.optional(element))return"dependency-mismatch";if(/[^0-9-]+/.test(value))return false;var nCheck=0,nDigit=0,bEven=false;value=value.replace(/\D/g,"");for(var n=value.length-1;n>=0;n--){var cDigit=value.charAt(n);var nDigit=parseInt(cDigit,10);if(bEven){if((nDigit*=2)>9)nDigit-=9;}nCheck+=nDigit;bEven=!bEven;}return(nCheck%10)==0;},accept:function(value,element,param){param=typeof param=="string"?param.replace(/,/g,'|'):"png|jpe?g|gif";return this.optional(element)||value.match(new RegExp(".("+param+")$","i"));},equalTo:function(value,element,param){var target=$(param).unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){$(element).valid();});return value==target.val();}}});$.format=$.validator.format;})(jQuery);;(function($){var ajax=$.ajax;var pendingRequests={};$.ajax=function(settings){settings=$.extend(settings,$.extend({},$.ajaxSettings,settings));var port=settings.port;if(settings.mode=="abort"){if(pendingRequests[port]){pendingRequests[port].abort();}return(pendingRequests[port]=ajax.apply(this,arguments));}return ajax.apply(this,arguments);};})(jQuery);;(function($){if(!jQuery.event.special.focusin&&!jQuery.event.special.focusout&&document.addEventListener){$.each({focus:'focusin',blur:'focusout'},function(original,fix){$.event.special[fix]={setup:function(){this.addEventListener(original,handler,true);},teardown:function(){this.removeEventListener(original,handler,true);},handler:function(e){arguments[0]=$.event.fix(e);arguments[0].type=fix;return $.event.handle.apply(this,arguments);}};function handler(e){e=$.event.fix(e);e.type=fix;return $.event.handle.call(this,e);}});};$.extend($.fn,{validateDelegate:function(delegate,type,handler){return this.bind(type,function(event){var target=$(event.target);if(target.is(delegate)){return handler.apply(target,arguments);}});}});})(jQuery);

/***************************** NEWSSCRIPT ****************************/

$(document).ready(function(){
$("#n_signup").validate({
debug: false,
rules: {
name: "required",
email: {
required: true,
email: true
}
},
messages: {
name: "Please let us know who you are.",
email: "A valid email will help us get in touch with you.",
},
submitHandler: function(form) {
$.post('scripts/n_process.php',
$("#n_signup").serialize(), function(data) {
$('#results').html(data);
});
}
});
});

function runEffect() {
setTimeout(function(){
var selectedEffect = 'blind';
var options = {};
$("#results").hide(selectedEffect, options, 500)
}, 5000);
} 

$(document).ready(function(){
$("#i_signup").validate({
debug: false,
rules: {
name: "required",
email: {
required: true,
email: true
}
},
messages: {
name: "Please let us know who you are.",
email: "A valid email will help us get in touch with you.",
},
submitHandler: function(form) {
$.post('scripts/i_process.php',
$("#i_signup").serialize(), function(data) {
$('#iresults').html(data);
});
}
});
});

function runEffect() {
setTimeout(function(){
var selectedEffect = 'blind';
var options = {};
$("#iresults").hide(selectedEffect, options, 500)
}, 5000);
} 

/***************************** OPACITY ****************************/

function handleOut(){
	$('#left').children().
css({ 'opacity' : 0.7 });

}
function handleOver(){
	$('#left').children().
css({ 'opacity' : 1 })

}

/***************************** BUTTONS ****************************/
var switchTo5x=true;

var cookie=new function(){return{setCookie:function(d,f,h){if(h){var c=new Date();c.setTime(c.getTime()+(h*24*60*60*1000));var a="; expires="+c.toGMTString()}else{var a=""}var b=d+"="+escape(f)+a;var g=document.domain.split(/\./);var e="";if(g.length>1){e="."+g[g.length-2]+"."+g[g.length-1]}b+="; domain="+escape(e)+";path=/";document.cookie=b},getCookie:function(b){var a=document.cookie.match("(^|;) ?"+b+"=([^;]*)(;|$)");if(a){return(unescape(a[2]))}else{return false}},deleteCookie:function(a){var c="/";var d=document.domain.split(/\./);var b="";if(d.length>1){b="."+d[d.length-2]+"."+d[d.length-1]}document.cookie=a+"="+((c)?";path="+c:"")+((b)?";domain="+b:"")+";expires=Thu, 01-Jan-1970 00:00:01 GMT"}}}();if(typeof(_gaq)!=="undefined"){_gaq.push(function(){var a=_gat._getTrackerByName();__stPubGA=a._getAccount()})}if(typeof(stLight)=="undefined"&&typeof(SHARETHIS)=="undefined"){var stRecentServices=false;var betaBlacklist=["computerworld.com","networkworld.com","cio.com","infoworld.com","forbes.com","perezhilton.com","pgestore.com","thepostgame.com"];if(typeof(switchTo5x)=="undefined"){switchTo5x=false;var rNumFor5x=cookie.getCookie("__switchTo5x");if(rNumFor5x==false){var rNumFor5x=1+Math.floor(Math.random()*100);cookie.setCookie("__switchTo5x",rNumFor5x,"300")}var testLimitFor5x=0;if(rNumFor5x<=testLimitFor5x){switchTo5x=true}for(var i=0;i<betaBlacklist.length;i++){if(document.domain.search(betaBlacklist[i])!="-1"){switchTo5x=false;break}}}stLight=new function(){this.publisher=null;this.sessionID_time=(new Date()).getTime().toString();this.sessionID_rand=Number(Math.random().toPrecision(5).toString().substr(2)).toString();this.sessionID=this.sessionID_time+"."+this.sessionID_rand;this.fpc=null;this.counter=0;this.readyRun=false;this.meta={hostname:document.location.host,location:document.location.pathname};this.loadedFromBar=false;this.clickCallBack=false};stLight.onReady=function(){stLight.readyRun=true;if(stLight.publisher==null){if(typeof(window.console)!=="undefined"){try{console.log("Please specify a ShareThis Publisher Key \nFor help, contact support@sharethis.com")}catch(a){}}}var b="share4x";if(switchTo5x){b="share5x"}if(stLight.hasButtonOnPage()){if(stLight.loadedFromBar){if(switchTo5x){b="bar_share5x"}else{b="bar_share4x"}}}else{if(stLight.loadedFromBar){b="bar"}}stLight.log("pview",b,"");stWidget.options.sessionID=stLight.sessionID;stWidget.options.fpc=stLight.fpc;stButtons.onReady()};stLight.log=function(d,e,c){var f=(("https:"==document.location.protocol)?"https://l.":"http://l.")+"sharethis.com/log?event=";if(d=="pview"){f=(("https:"==document.location.protocol)?"https://l.":"http://l.")+"sharethis.com/pview?event="}var a=stLight.dbrInfo();if(a==false){a=""}f+=d;f+="&source="+e;if(c!=""){f+="&type="+c}f+="&publisher="+encodeURIComponent(stLight.publisher)+"&hostname="+encodeURIComponent(stLight.meta.hostname)+"&location="+encodeURIComponent(stLight.meta.location)+"&url="+encodeURIComponent(document.location.href)+"&sessionID="+stLight.sessionID+"&fpc="+stLight.fpc+"&ts"+(new Date()).getTime()+"."+stLight.counter+++a;var b=new Image(1,1);b.src=f;b.onload=function(){return};if(d=="pview"){stLight.createSegmentFrame()}};stLight._stFpc=function(){if(!document.domain||document.domain.search(/\.gov/)>0){return false}var g=stLight._stGetFpc("__unam");if(g==false){var c=Math.round(Math.random()*2147483647);c=c.toString(16);var h=(new Date()).getTime();h=h.toString(16);var e="";var a=stLight._stGetD();a=a.split(/\./)[1];if(!a){return false}e=stLight._stdHash(a)+"-"+h+"-"+c+"-1";g=e;stLight._stSetFpc(g)}else{var b=g;var f=b.split(/\-/);if(f.length==4){var d=Number(f[3]);d++;b=f[0]+"-"+f[1]+"-"+f[2]+"-"+d;g=b;stLight._stSetFpc(g)}}return g};stLight._stSetFpc=function(g){var a="__unam";var c=new Date;var j=c.getFullYear();var f=c.getMonth()+9;var h=c.getDate();var d=a+"="+escape(g);if(j){var b=new Date(j,f,h);d+="; expires="+b.toGMTString()}var e=stLight._stGetD();d+="; domain="+escape(e)+";path=/";document.cookie=d};stLight._stGetD=function(){var b=document.domain.split(/\./);var a="";if(b.length>1){a="."+b[b.length-2]+"."+b[b.length-1]}return a};stLight._stGetFpc=function(b){var a=document.cookie.match("(^|;) ?"+b+"=([^;]*)(;|$)");if(a){return(unescape(a[2]))}else{return false}};stLight._stdHash=function(a){var e=0,d=0;for(var c=a.length-1;c>=0;c--){var b=parseInt(a.charCodeAt(c));e=((e<<8)&268435455)+b+(b<<12);if((d=e&161119850)!=0){e=(e^(d>>20))}}return e.toString(16)};stLight._thisScript=null;stLight.getShareThisLightScript=function(){var d=document.getElementsByTagName("script");var c=null;for(var b=0;b<d.length;b++){var a=d[b].src;if(a.search(/.*sharethis.*\/button\/light.*/)>=0){c=d[b]}}return c};stLight.dbrInfo=function(){var a=document.referrer;var d=new RegExp(document.domain,"gi");if(d.test(a)==true){return false}if(a&&a.length>0){var c=/(http:\/\/)(.*?)\/.*/i;var b=/(^.*\?)(.*)/ig;var g="";var f=a.replace(c,"$2");if(f.length>0){g+="&refDomain="+f}else{return false}var e=a.replace(b,"$2");if(e.length>0){g+="&refQuery="+encodeURIComponent(e)}return g}else{return false}};stLight.odjs=function(a,b){this.head=document.getElementsByTagName("head")[0];this.scriptSrc=a;this.script=document.createElement("script");this.script.setAttribute("type","text/javascript");this.script.setAttribute("src",this.scriptSrc);this.script.onload=b;this.script.onreadystatechange=function(){if(this.readyState=="loaded"||this.readyState=="complete"){b()}};this.head.appendChild(this.script)};if(window.document.readyState=="completed"){stLight.onReady()}else{if(typeof(window.addEventListener)!="undefined"){window.addEventListener("load",stLight.onReady,false)}else{if(typeof(document.addEventListener)!="undefined"){document.addEventListener("load",stLight.onReady,false)}else{if(typeof window.attachEvent!="undefined"){window.attachEvent("onload",stLight.onReady)}}}}stLight.createSegmentFrame=function(){try{stLight.segmentframe=document.createElement('<iframe name="stframe" allowTransparency="true" style="body{background:transparent;}" ></iframe>')}catch(b){stLight.segmentframe=document.createElement("iframe")}stLight.segmentframe.id="stSegmentFrame";stLight.segmentframe.name="stSegmentFrame";var c=document.body;var a=(("https:"==document.location.protocol)?"https://seg.":"http://seg.")+"sharethis.com/getSegment.php?purl="+encodeURIComponent(document.location.href)+"&jsref="+encodeURIComponent(document.referrer)+"&rnd="+(new Date()).getTime();stLight.segmentframe.src=a;stLight.segmentframe.frameBorder="0";stLight.segmentframe.scrolling="no";stLight.segmentframe.width="0px";stLight.segmentframe.height="0px";stLight.segmentframe.setAttribute("style","display:none;");c.appendChild(stLight.segmentframe)};stLight.fpc=stLight._stFpc();stLight.options=function(a){if(a&&a.publisher){stLight.publisher=a.publisher}if(a&&a.loadedFromBar){stLight.loadedFromBar=a.loadedFromBar}if(a&&a.clickCallBack&&typeof(a.clickCallBack)=="function"){stLight.clickCallBack=a.clickCallBack}for(var b in a){if(stWidget.options.hasOwnProperty(b)&&a[b]!==null){stWidget.options[b]=a[b]}}};stLight.hasButtonOnPage=function(){var d=document.getElementsByTagName("*");var c=new RegExp(/^st_(.*?)$/);var a=d.length;for(var b=0;b<a;b++){if(typeof(d[b].className)=="string"&&d[b].className!=""){if(d[b].className.match(c)&&d[b].className.match(c).length>=2&&d[b].className.match(c)[1]){return true}}}return false}}var stButtons={};stButtons.smartifyButtons=function(a){if(typeof(a)!="undefined"&&a!="undefined"){stRecentServices=a;for(var b in stRecentServices){stRecentServices[b].processed=false}}stButtons.completeInit()};stButtons.makeButton=function(d){var J=d.service;var u=d.text;if(u==null&&(d.type=="vcount"||d.type=="hcount")){u="Share"}if(J=="fb_like"){J="fblike"}var j=stWidget.ogurl?stWidget.ogurl:document.location.href;j=d.url?d.url:j;var I=stWidget.ogtitle?stWidget.ogtitle:document.title;I=d.title?d.title:I;var x=(d.thumbnail&&d.thumbnail!=null)?d.thumbnail:stWidget.ogimg;var n=stWidget.desc?stWidget.desc:"";n=stWidget.ogdesc?stWidget.ogdesc:stWidget.desc;n=(d.description&&d.description!=null)?d.description:n;if(/(http|https):\/\//.test(j)==false){j=decodeURIComponent(j);I=decodeURIComponent(I)}if(/(http|https):\/\//.test(j)==false){j=decodeURIComponent(j);I=decodeURIComponent(I)}var G=document.createElement("span");G.setAttribute("style","text-decoration:none;color:#000000;display:inline-block;cursor:pointer;");G.className="stButton";if(d.type=="custom"){d.element.onclick=function(){var K=document.createElement("form");K.setAttribute("method","GET");K.setAttribute("action","http://wd.sharethis.com/api/sharer.php");K.setAttribute("target","_blank");var L={url:j,title:I,destination:J,publisher:stLight.publisher,fpc:stLight.fpc,sessionID:stLight.sessionID};if(typeof(x)!="undefined"&&x!=null){L.image=x}if(typeof(n)!="undefined"&&n!=null){L.desc=n}L.service=d.service;L.type=d.type;for(var b in L){var a=document.createElement("input");a.setAttribute("type","hidden");a.setAttribute("name",b);a.setAttribute("value",L[b]);K.appendChild(a)}document.body.appendChild(K);K.submit()};return false}if(!((J=="email"||J=="sharethis")||(switchTo5x&&(J=="facebook"||J=="twitter"||J=="gbuzz"||J=="yahoo"||J=="linkedin")))){G.onclick=function(){if(stWidget.options.tracking){shareLog(J)}var K=document.createElement("form");K.setAttribute("method","GET");K.setAttribute("action","http://wd.sharethis.com/api/sharer.php");K.setAttribute("target","_blank");var L={url:j,title:I,destination:J,publisher:stLight.publisher,fpc:stLight.fpc,sessionID:stLight.sessionID};if(typeof(x)!="undefined"&&x!=null){L.image=x}if(typeof(n)!="undefined"&&n!=null){L.desc=n}L.service=d.service;L.type=d.type;for(var b in L){var a=document.createElement("input");a.setAttribute("type","hidden");a.setAttribute("name",b);a.setAttribute("value",L[b]);K.appendChild(a)}document.body.appendChild(K);K.submit()}}if(J=="fblike"){try{var w=document.createElement('<iframe name="stLframe" scrolling="no" frameBorder="0" allowTransparency="true" style="body{background:transparent;}" ></iframe>')}catch(k){w=document.createElement("iframe");w.allowTransparency="true";w.setAttribute("allowTransparency","true");w.frameBorder="0";w.setAttribute("frameBorder","0");w.scrolling="no";w.setAttribute("scrolling","no")}var q="http://wd.sharethis.com/api/sharer.php?destination=fblike&url="+encodeURIComponent(j);var C="button_count";if(d.type=="vcount"){C="box_count";w.setAttribute("style","border:none; overflow:hidden; width:55px; height:65px; position:relative; top:12px;");w.width="55px";w.height="65px"}else{w.setAttribute("style","border:none; overflow:hidden; width:90px; height:21px; position:relative; top:7px;");w.width="90px";w.height="21px"}w.src="http://www.facebook.com/plugins/like.php?href="+encodeURIComponent(q)+"&layout="+C+"&show_faces=true&width=90&action=like&colorscheme=light&height=21";return w}if(d.type=="chicklet"){var z=document.createElement("span");z.className="chicklets "+J;if(u==null){z.innerHTML="&nbsp;"}else{z.appendChild(document.createTextNode(u))}G.appendChild(z);return G}else{if(d.type=="large"){var z=document.createElement("span");z.className="stLarge";var g=("https:"==document.location.protocol)?"https://ws.sharethis.com/images/":"http://w.sharethis.com/images/";z.style.backgroundImage="url('"+g+J+"_32.png')";G.appendChild(z);return G}else{if(d.type=="pcount"||d.type=="stbar"||d.type=="stsmbar"){var c=document.createElement("span");var z=document.createElement("span");if(d.type=="stsmbar"){z.className="stSmBar";var g=("https:"==document.location.protocol)?"https://ws.sharethis.com/images/":"http://w.sharethis.com/images/";z.style.backgroundImage="url('"+g+J+"_16.png')"}else{z.className="stLarge";var g=("https:"==document.location.protocol)?"https://ws.sharethis.com/images/":"http://w.sharethis.com/images/";z.style.backgroundImage="url('"+g+J+"_32.png')"}c.appendChild(z);var p=document.createElement("span");var E=document.createElement("div");if(d.type=="stsmbar"){E.className="stBubbleSmHoriz"}else{E.className="stBubbleSm"}E.setAttribute("id","stBubble_"+d.count);E.style.visibility="hidden";var m=document.createElement("div");m.className="stBubble_count_sm";E.appendChild(m);p.appendChild(E);p.appendChild(c);G.appendChild(p);stButtons.getCount(j,J,m);c.onmouseover=function(){var a=document.getElementById("stBubble_"+d.count);a.style.visibility="visible"};c.onmouseout=function(){var a=document.getElementById("stBubble_"+d.count);a.style.visibility="hidden"};return G}else{if(d.type=="button"||d.type=="vcount"||d.type=="hcount"){var c=document.createElement("span");c.className="stButton_gradient";var r=document.createElement("span");r.className="chicklets "+J;if(u==null){r.innerHTML="&nbsp;"}else{r.appendChild(document.createTextNode(u))}c.appendChild(r);if(J=="twitter"){var B=document.createElement("span");B.className="stTwbutton";B.innerHTML="&nbsp;";c=B}else{if(J=="facebook"){var A=document.createElement("span");A.className="stFb";A.innerHTML="&nbsp;";c=A}}if(d.type=="vcount"){var p=document.createElement("div");var E=document.createElement("div");E.className="stBubble";var m=document.createElement("div");m.className="stBubble_count";E.appendChild(m);p.appendChild(E);p.appendChild(c);G.appendChild(p);stButtons.getCount(j,J,m)}else{if(d.type=="hcount"){var p=document.createElement("span");var D=document.createElement("span");D.className="stButton_gradient stHBubble";var o=document.createElement("span");o.className="stButton_left";o.innerHTML="&nbsp;";var e=document.createElement("span");e.className="stButton_right";e.innerHTML="&nbsp;";var m=document.createElement("span");m.className="stBubble_hcount";D.appendChild(m);p.appendChild(c);var F=document.createElement("span");F.className="stArrow";F.appendChild(D);p.appendChild(F);G.appendChild(p);stButtons.getCount(j,J,m)}else{G.appendChild(c)}}}else{if(d.type=="css"){var c=document.createElement("div");c.className="stCSSButton";if(d.cssType=="cssV"){var h=document.createElement("div");h.className="stCSSVBubble";var l=document.createElement("div");l.className="stCSSVBubble_count";h.appendChild(l);var H=document.createElement("div");H.className="stCSSVArrow";var t=document.createElement("div");t.className="stCSSVArrowBorder";t.appendChild(H);G.appendChild(h);G.appendChild(t);stButtons.getCount(j,J,l)}var s=document.createElement("div");s.className="stCSSSprite "+J;s.innerHTML="&nbsp;";var z=document.createElement("span");z.className="stCSSText";if(u==null){z.innerHTML="&nbsp;"}else{z.appendChild(document.createTextNode(u))}c.appendChild(s);c.appendChild(z);G.appendChild(c);if(d.cssType=="cssH"){var v=document.createElement("div");v.className="stCSSHBubble";var l=document.createElement("div");l.className="stCSSHBubble_count";v.appendChild(l);var f=document.createElement("div");f.className="stCSSHArrow";var y=document.createElement("div");y.className="stCSSHArrowBorder";y.appendChild(f);G.appendChild(y);G.appendChild(v);stButtons.getCount(j,J,l)}}}}}}return G};stButtons.getCount=function(c,a,d){var b=false;if(d&&d!==null){while(d.childNodes.length>=1){try{d.removeChild(d.firstChild)}catch(e){}}}stButtons.cbQueue.push({url:c,service:a,element:d});stButtons.getCountsFromService(c,a,d)};stButtons.processCB=function(b){var a=false;for(var c=0;c<stButtons.cbQueue.length;c++){var e=stButtons.cbQueue[c];if(b.ourl==e.url){var f="";try{if(e.service=="sharethis"){if(stWidget.options.newOrZero=="zero"){f=(b.total>0)?stButtons.human(b.total):"0"}else{f=(b.total>0)?stButtons.human(b.total):"New"}}else{if(e.service=="facebook"&&typeof(b.facebook2)!="undefined"){f=stButtons.human(b.facebook2)}else{if(typeof(b[e.service])!="undefined"){f=(b[e.service]>0)?stButtons.human(b[e.service]):"0"}else{f="0"}}}e.element.innerHTML=f}catch(d){}a=true}}};stButtons.human=function(a){if(a>=10000){a=a/100;a=Math.round(a);a=a/10;a=a+"K"}return a};stButtons.locateElements=function(c){var D=document.getElementsByTagName("*");var C=[];var F=new RegExp(/st_(.*?)_custom/);var E=new RegExp(/st_(.*?)_vcount/);var A=new RegExp(/st_(.*?)_hcount/);var v=new RegExp(/st_(.*?)_button/);var u=new RegExp(/st_(.*?)_large/);var s=new RegExp(/st_(.*?)_pcount/);var p=new RegExp(/st_(.*?)_stbar/);var n=new RegExp(/st_(.*?)_stsmbar/);var m=new RegExp(/st_(.*?)_css/);var a=new RegExp(/^st_(.*?)$/);var t=D.length;var o=0,g,l,w,b=[],G=false;if(typeof(stRecentServices)!="undefined"&&stRecentServices!="undefined"&&stRecentServices!="false"&&stRecentServices){G=true}for(var r=0;r<t;r++){g="";l=false;w=false;if(typeof(D[r].className)=="string"&&D[r].className!=""){if(D[r].className.match(F)&&D[r].className.match(F).length>=2&&D[r].className.match(F)[1]){if(stButtons.testElem(D[r])==false){w=true;g=D[r].className.match(F)[1];stButtons.elemArr.push(D[r]);C.push({service:g,element:D[r],url:D[r].getAttribute("st_url"),title:D[r].getAttribute("st_title"),image:(D[r].getAttribute("st_img")!=null)?D[r].getAttribute("st_img"):D[r].getAttribute("st_image"),summary:D[r].getAttribute("st_summary"),text:D[r].getAttribute("displayText"),type:"custom"})}}else{if(D[r].className.match(E)&&D[r].className.match(E).length>=2&&D[r].className.match(E)[1]){if(stButtons.testElem(D[r])==false){w=true;g=D[r].className.match(E)[1];stButtons.elemArr.push(D[r]);C.push({service:g,element:D[r],url:D[r].getAttribute("st_url"),title:D[r].getAttribute("st_title"),image:(D[r].getAttribute("st_img")!=null)?D[r].getAttribute("st_img"):D[r].getAttribute("st_image"),summary:D[r].getAttribute("st_summary"),text:D[r].getAttribute("displayText"),type:"vcount"})}}else{if(D[r].className.match(A)&&D[r].className.match(A).length>=2&&D[r].className.match(A)[1]){if(stButtons.testElem(D[r])==false){w=true;g=D[r].className.match(A)[1];stButtons.elemArr.push(D[r]);C.push({service:g,element:D[r],url:D[r].getAttribute("st_url"),title:D[r].getAttribute("st_title"),image:(D[r].getAttribute("st_img")!=null)?D[r].getAttribute("st_img"):D[r].getAttribute("st_image"),summary:D[r].getAttribute("st_summary"),text:D[r].getAttribute("displayText"),type:"hcount"})}}else{if(D[r].className.match(v)&&D[r].className.match(v).length>=2&&D[r].className.match(v)[1]){if(stButtons.testElem(D[r])==false){w=true;g=D[r].className.match(v)[1];stButtons.elemArr.push(D[r]);C.push({service:g,element:D[r],url:D[r].getAttribute("st_url"),title:D[r].getAttribute("st_title"),image:(D[r].getAttribute("st_img")!=null)?D[r].getAttribute("st_img"):D[r].getAttribute("st_image"),summary:D[r].getAttribute("st_summary"),text:D[r].getAttribute("displayText"),type:"button"})}}else{if(D[r].className.match(u)&&D[r].className.match(u).length>=2&&D[r].className.match(u)[1]){if(stButtons.testElem(D[r])==false){w=true;g=D[r].className.match(u)[1];stButtons.elemArr.push(D[r]);C.push({service:g,element:D[r],url:D[r].getAttribute("st_url"),title:D[r].getAttribute("st_title"),image:(D[r].getAttribute("st_img")!=null)?D[r].getAttribute("st_img"):D[r].getAttribute("st_image"),summary:D[r].getAttribute("st_summary"),text:D[r].getAttribute("displayText"),type:"large"})}}else{if(D[r].className.match(s)&&D[r].className.match(s).length>=2&&D[r].className.match(s)[1]){if(stButtons.testElem(D[r])==false){w=true;g=D[r].className.match(s)[1];stButtons.elemArr.push(D[r]);C.push({service:g,element:D[r],url:D[r].getAttribute("st_url"),title:D[r].getAttribute("st_title"),image:(D[r].getAttribute("st_img")!=null)?D[r].getAttribute("st_img"):D[r].getAttribute("st_image"),summary:D[r].getAttribute("st_summary"),text:D[r].getAttribute("displayText"),type:"pcount",count:r})}}else{if(D[r].className.match(p)&&D[r].className.match(p).length>=2&&D[r].className.match(p)[1]){if(stButtons.testElem(D[r])==false){w=true;g=D[r].className.match(p)[1];stButtons.elemArr.push(D[r]);C.push({service:g,element:D[r],url:D[r].getAttribute("st_url"),title:D[r].getAttribute("st_title"),image:(D[r].getAttribute("st_img")!=null)?D[r].getAttribute("st_img"):D[r].getAttribute("st_image"),summary:D[r].getAttribute("st_summary"),text:D[r].getAttribute("displayText"),type:"stbar",count:r})}}else{if(D[r].className.match(n)&&D[r].className.match(n).length>=2&&D[r].className.match(n)[1]){if(stButtons.testElem(D[r])==false){w=true;g=D[r].className.match(n)[1];stButtons.elemArr.push(D[r]);C.push({service:g,element:D[r],url:D[r].getAttribute("st_url"),title:D[r].getAttribute("st_title"),image:(D[r].getAttribute("st_img")!=null)?D[r].getAttribute("st_img"):D[r].getAttribute("st_image"),summary:D[r].getAttribute("st_summary"),text:D[r].getAttribute("displayText"),type:"stsmbar",count:r})}}else{if(D[r].className.match(m)&&D[r].className.match(m).length>=2&&D[r].className.match(m)[1]){if(stButtons.testElem(D[r])==false){w=true;g=D[r].className.match(m)[1];stButtons.elemArr.push(D[r]);var B=D[r].className.split("_");C.push({service:g,element:D[r],url:D[r].getAttribute("st_url"),title:D[r].getAttribute("st_title"),image:(D[r].getAttribute("st_img")!=null)?D[r].getAttribute("st_img"):D[r].getAttribute("st_image"),summary:D[r].getAttribute("st_summary"),text:D[r].getAttribute("displayText"),type:"css",cssType:B[B.length-1]})}}else{if(D[r].className.match(a)&&D[r].className.match(a).length>=2&&D[r].className.match(a)[1]){if(stButtons.testElem(D[r])==false){w=true;g=D[r].className.match(a)[1];stButtons.elemArr.push(D[r]);C.push({service:g,element:D[r],url:D[r].getAttribute("st_url"),title:D[r].getAttribute("st_title"),image:(D[r].getAttribute("st_img")!=null)?D[r].getAttribute("st_img"):D[r].getAttribute("st_image"),summary:D[r].getAttribute("st_summary"),text:D[r].getAttribute("displayText"),type:"chicklet"})}}}}}}}}}}}if(G){if(w){stButtons.elemArr.push(D[r]);for(o=0;o<b.length;o++){if(b[o].service==g){b[o].count++;l=true}}if(!l){b.push({service:g,count:1,doNotReplace:false,processed:false})}}}}}if(G){var j=[];for(var f=b.length-1;f>=0;f--){if(b[f].service=="sharethis"||b[f].doNotReplace){b[f].processed=true;continue}else{for(var e in stRecentServices){var h=false;if(!stRecentServices[e].processed){for(var q=0;q<b.length;q++){if(e==b[q].service&&!b[q].processed){h=true;b[q].doNotReplace=true;stRecentServices[e].processed=true;break}}if(h){b[f].processed=true}else{j.push({oldService:b[f].service,newService:e});for(var d=0;d<C.length;d++){if(C[d].service==b[f].service){C[d].service=e;C[d].text=stRecentServices[e].title;C[d].element.setAttribute("displayText",stRecentServices[e].title);C[d].element.className=C[d].element.className.replace(b[f].service,e)}}stRecentServices[e].processed=true;b[f].processed=true;break}}}}}}for(var r=0;r<C.length;r++){stWidget.addEntry(C[r])}};stButtons.odcss=function(a,b){this.head=document.getElementsByTagName("head")[0];this.scriptSrc=a;this.css=document.createElement("link");this.css.setAttribute("rel","stylesheet");this.css.setAttribute("type","text/css");this.css.setAttribute("href",this.scriptSrc);setTimeout(function(){b()},500);this.head.appendChild(this.css)};stButtons.makeButtons=function(){var a=(("https:"==document.location.protocol)?"https://ws.sharethis.com/button/css/buttons-secure.css":"http://w.sharethis.com/button/css/buttons.css");stButtons.odcss(a,function(){});stButtons.locateElements()};stButtons.addCount=function(a){stButtons.counts.push(a)};stButtons.getCountsFromService=function(c,b,d){if(stButtons.checkQueue(c)==false){var a=a+"-"+stButtons.cbVal;a="stButtons.processCB";stButtons.cbVal++;var e=(("https:"==document.location.protocol)?"https://ws.sharethis.com/api/getCount2.php?cb="+a+"&url=":"http://wd.sharethis.com/api/getCount2.php?cb="+a+"&url=");stLight.odjs(e+encodeURIComponent(c),function(){});stButtons.queue.push(c)}};stButtons.checkQueue=function(a){for(var b=0;b<stButtons.queue.length;b++){if(stButtons.queue[b]==a){return true}}return false};stButtons.elemArr=[];stButtons.testElem=function(c){var a=false;for(var b=0;b<stButtons.elemArr.length;b++){if(c==stButtons.elemArr[b]){a=true}}if(a==true){return true}else{return false}};function Shareable(c){var a={};a.facebook="450";a.twitter="684";a.yahoo="500";a.gbuzz="550";a.linkedin="600";var b={};b.facebook="300";b.twitter="718";b.yahoo="460";b.gbuzz="400";b.linkedin="433";this.idx=-1;this.url=null;this.title=null;this.image=null;this.element=null;this.service=null;this.screen="home";this.summary=null;this.content=null;this.buttonText=null;this.frag=null;this.onhover=true;this.type=null;var d=this;var e=false;this.attachButton=function(f){this.element=f;if((this.onhover==true||this.onhover=="true")&&(this.popup==false||this.popup=="false")&&((!switchTo5x)||(switchTo5x&&(c.service=="sharethis"||c.service=="email")))){f.onmouseover=this.mouseOn;f.onmouseout=this.mouseOut}f.onclick=function(){if(switchTo5x){if(c&&(c.service=="yahoo"||c.service=="buzz"||c.service=="facebook"||c.service=="twitter"||c.service=="gbuzz"||c.service=="linkedin")){if(c.service=="buzz"||c.service=="gbuzz"){oAuthURL="http://rest.sharethis.com/auth/getOAuth.php?provider=buzz&linking=true&pub_key=12be4dda-f838-40e0-b748-f78357a63cc8&access_key=96ba6b476151d07e675125a7cc8ec0ea&redirect_url=http://sharethis.com"}else{oAuthURL="http://sharethis.com/account/linking?provider="+c.service}window.open(oAuthURL,"AccountLinkingWindow","status=1, height="+b[c.service]+", width="+a[c.service]+", resizable=0")}}d.popup()}};this.init=function(){stWidget.merge(this,c);stWidget.shareables.push(this);if(c.element!==null){this.attachButton(c.element)}};return this}var stWidget=new function(){this.shareables=[];this.entries=0;this.widgetOpen=false;this.mouseOnTimer=null;this.mouseOutTimer=null;this.frameReady=false;if(switchTo5x){this.frameUrl=(("https:"==document.location.protocol)?"https://ws.sharethis.com/secure5x/index.html":"http://edge.sharethis.com/share5x/index.a49e552a916d5e0defd35136236d0f74.html")}else{this.frameUrl=(("https:"==document.location.protocol)?"https://ws.sharethis.com/secure/index.html":"http://edge.sharethis.com/share4x/index.54632d345c93180a48e59b5183c99baf.html")}this.secure=false;try{this.mainstframe=document.createElement('<iframe name="stLframe" allowTransparency="true" style="body{background:transparent;}" ></iframe>');this.mainstframe.onreadystatechange=function(){if(stWidget.mainstframe.readyState==="complete"){stWidget.frameReady=true}}}catch(a){this.mainstframe=document.createElement("iframe");this.mainstframe.allowTransparency="true";this.mainstframe.setAttribute("allowTransparency","true");this.mainstframe.onload=function(){stWidget.frameReady=true}}this.mainstframe.id="stLframe";this.mainstframe.className="stLframe";this.mainstframe.name="stLframe";this.mainstframe.frameBorder="0";this.mainstframe.scrolling="no";this.mainstframe.width="345px";this.mainstframe.height="450px";this.mainstframe.style.top="0px";this.mainstframe.style.left="0px";this.mainstframe.src="";this.wrapper=document.createElement("div");this.wrapper.id="stwrapper";this.wrapper.className="stwrapper";this.wrapper.style.visibility="hidden";this.wrapper.style.top="-999px";this.wrapper.style.left="-999px";this.closewrapper=document.createElement("div");this.closewrapper.className="stclose";if(switchTo5x){this.mainstframe.width="500px";this.mainstframe.height="430px";this.wrapper.style.top="-999px";this.wrapper.style.left="-999px";this.wrapper.style.width="500px";this.wrapper.style.zIndex=89999999;this.overlay=document.createElement("div");this.overlay.style.height="100%";this.overlay.style.width="100%";this.overlay.style.backgroundColor="#000";this.overlay.style.opacity="0.6";this.overlay.style.filter="Alpha(Opacity=60)";this.overlay.style.position="fixed";if(document.all&&navigator.appVersion.indexOf("MSIE 6.")!=-1){this.overlay.style.position="absolute"}this.overlay.style.display="none";this.overlay.style.left="0";this.overlay.style.top="0";this.overlay.style.zIndex=89999990;this.overlay.setAttribute("id","stOverlay");this.closewrapper.className="stCloseNew2"}this.closewrapper.onclick=function(){stWidget.closeWidget()};this.wrapper.appendChild(this.closewrapper);this.wrapper.appendChild(this.mainstframe);this.ogtitle=null;this.ogdesc=null;this.ogurl=null;this.ogimg=null;this.ogtype=null;this.desc=null;this.initFire=false;this.merge=function(d,c){for(var b in c){if(d.hasOwnProperty(b)&&c[b]!==null){d[b]=c[b]}}};this.oldScroll=0;this.init=function(){if(stWidget.initFire==false){stWidget.initFire=true;window.frames.stLframe.location.replace(stWidget.frameUrl+stWidget.createFrag(null,"init"))}}};stWidget.options=new function(){this.fpc=stLight.fpc;this.sessionID=null;this.publisher=null;this.tracking=true;this.send_services=null;this.exclusive_services=null;this.headerTitle=null;this.headerfg=null;this.headerbg=null;this.offsetLeft=null;this.offsetTop=null;this.onhover=true;this.autoclose=true;this.autoPosition=true;this.embeds=false;this.doneScreen=true;this.minorServices=true;this.excludeServices=null;this.theme=1;this.serviceBarColor=null;this.shareButtonColor=null;this.footerColor=null;this.headerTextColor=null;this.helpTextColor=null;this.mainWidgetColor=null;this.textBoxFontColor=null;this.textRightToLeft=false;this.shorten=true;this.popup=false;this.newOrZero="new";this.publisherGA=null};stWidget.addEntry=function(a){if(!a.element){return false}if(a&&((a.service=="email"||a.service=="sharethis")||(switchTo5x&&(a.service=="facebook"||a.service=="twitter"||a.service=="gbuzz"||a.service=="yahoo"||a.service=="linkedin")))){openWidget=true}else{openWidget=false}if(!openWidget){if(a.type!=="custom"){a.element.appendChild(stButtons.makeButton(a))}else{if(!(a.type=="custom"&&a.service=="sharethis")){stButtons.makeButton(a)}}return true}else{if(a.type!="custom"){a.element.appendChild(stButtons.makeButton(a))}else{if(!(a.type=="custom"&&a.service=="sharethis")){stButtons.makeButton(a)}}var b=new Shareable(a);b.idx=stWidget.entries;stWidget.entries++;b.publisher=stLight.publisher;b.sessionID=stLight.sessionID;b.fpc=stLight.fpc;if(a.element.image==null&&stWidget.ogimg!=null){b.image=stWidget.ogimg}if(a.element.summary==null&&stWidget.ogdesc!=null){b.summary=stWidget.ogdesc}else{if(a.element.summary==null&&stWidget.desc!=null){b.summary=stWidget.desc}}b.url=stWidget.ogurl?stWidget.ogurl:document.location.href;b.url=a.url?a.url:b.url;b.title=stWidget.ogtitle?stWidget.ogtitle:document.title;b.title=a.title?a.title:b.title;stWidget.merge(b,stWidget.options);if(typeof(stWidget.options.textRightToLeft)!="undefined"&&stWidget.options.textRightToLeft!="null"&&stWidget.options.textRightToLeft==true){document.getElementById("stwrapper").style.top="auto";document.getElementById("stwrapper").style.left="auto"}b.mouseOn=function(){stWidget.mouseOnTimer=setTimeout(b.popup,500)};b.mouseOut=function(){clearInterval(stWidget.mouseOnTimer)};b.popup=function(){if(stWidget.widgetOpen==false){var d="share4x";if(switchTo5x){d="share5x";try{if(stLight.clickCallBack!=false){stLight.clickCallBack(a.service)}}catch(c){}}if(a.type=="stbar"||a.type=="stsmbar"){d="bar"}stLight.log("widget",d,a.service+"_"+a.type);if(stWidget.options.popup&&!switchTo5x){window.open(stWidget.frameUrl+stWidget.createFrag(b),"newstframe","status=1,toolbar=0,width=345,height=670")}else{window.frames.stLframe.location.replace(stWidget.frameUrl+stWidget.createFrag(b));stWidget.positionWidget(b);if(stWidget.options.embeds==false){stWidget.hideEmbeds()}setTimeout(function(){stWidget.widgetOpen=true;st_showing=true},200)}}else{if(stWidget.widgetOpen==true&&stWidget.options.onhover==false){}}return false};b.init();return b}};stWidget.createFrag=function(c,b){var f="#light";if(b=="init"){f="#init";if(stWidget.options.tracking&&stWidget.options.publisherGA==null){if(typeof(pageTracker)!="undefined"&&pageTracker!==null){stWidget.options.publisherGA=pageTracker._getAccount()}else{if(stWidget.options.publisherGA==null&&typeof(__stPubGA)!=="undefined"){stWidget.options.publisherGA=__stPubGA}}}for(var e in stWidget.options){if(stWidget.options.hasOwnProperty(e)==true&&stWidget.options[e]!==null&&typeof(stWidget.options[e])!="function"&&typeof(stWidget.options[e])!="object"){var a=stWidget.options[e];try{a=decodeURIComponent(a);a=decodeURIComponent(a)}catch(d){}f=f+"/"+e+"="+encodeURIComponent(a)}}f=f+"/pUrl="+encodeURIComponent(encodeURIComponent(document.location.href))+((document.title!="")?"/title="+encodeURIComponent(encodeURIComponent(document.title)):"")+"/stLight=true"}else{for(var e in c){if(c.hasOwnProperty(e)==true&&c[e]!==null&&typeof(c[e])!="function"&&typeof(c[e])!="object"&&e!=="idx"){f=f+"/"+e+"-=-"+encodeURIComponent(encodeURIComponent(c[e]))}}if(c.service=="email"){f=f+"/page-=-send"}if(switchTo5x){if(c.service=="facebook"){f=f+"/page-=-fbhome"}else{if(c.service=="twitter"){f=f+"/page-=-twhome"}else{if(c.service=="gbuzz"){f=f+"/page-=-gbhome"}else{if(c.service=="yahoo"){f=f+"/page-=-ybhome"}else{if(c.service=="linkedin"){f=f+"/page-=-lihome"}}}}}}}return f};stWidget.positionWidget=function(o){if(!o){return false}if(!switchTo5x){shareel=o.element;var curleft=curtop=0;if(shareel.offsetParent){curleft=shareel.offsetLeft;curtop=shareel.offsetTop;while(shareel=shareel.offsetParent){curleft+=shareel.offsetLeft;curtop+=shareel.offsetTop}}shareel=o.element;var eltop=0;var elleft=0;var topVal=0;var leftVal=0;var elemH=0;var elemW=0;eltop=curtop+shareel.offsetHeight+5;elleft=curleft+5;topVal=(eltop+(stWidget.options.offsetTop?stWidget.options.offsetTop:0));topVal=eval(topVal);elemH=topVal;topVal+="px";leftVal=(elleft+(stWidget.options.offsetLeft?stWidget.options.offsetLeft:0));leftVal=eval(leftVal);elemW=leftVal;leftVal+="px";stWidget.wrapper.style.top=topVal;stWidget.wrapper.style.left=leftVal;if(stWidget.options.autoPosition==true){stWidget.oldScroll=document.body.scrollTop;var pginfo=stWidget.pageSize();var effectiveH=pginfo.height+pginfo.scrY;var effectiveW=pginfo.width+pginfo.scrX;var widgetH=180;var widgetW=355;var needH=widgetH+elemH;var needW=widgetW+elemW;var diffH=needH-effectiveH;var diffW=needW-effectiveW;var newH=elemH-diffH;var newW=elemW-diffW;function getHW(elem){var retH=0;var retW=0;while(elem!=null){retH+=elem.offsetTop;retW+=elem.offsetLeft;elem=elem.offsetParent}return{height:retH,width:retW}}var buttonPos=getHW(shareel);var leftA,rightA,topA,bottomA=false;if(diffH>0){bottomA=false;topA=true;if((buttonPos.height-widgetH)>0){newH=buttonPos.height-widgetH}stWidget.wrapper.style.top=newH+"px"}if(diffW>0){leftA=false;rightA=true;if((buttonPos.width-widgetW)>0){newW=buttonPos.width-widgetW}stWidget.wrapper.style.left=newW+"px"}}if(stWidget.options.autoPosition=="center"){stWidget.wrapper.style.top="15%";stWidget.wrapper.style.left="35%";stWidget.wrapper.style.position="fixed"}}else{document.getElementById("stOverlay").style.display="block";var topVal;if(stWidget.options.autoPosition==true){if(document.all&&navigator.appVersion.indexOf("MSIE 7.")!=-1){stWidget.wrapper.style.left="500px"}else{stWidget.wrapper.style.left="10%"}stWidget.wrapper.style.right="10%";topVal=(document.documentElement.clientHeight-parseFloat(stWidget.wrapper.offsetHeight)/2)/2;if(topVal>20){topVal=20}else{if(topVal<5){topVal=5}}stWidget.wrapper.style.top=topVal+"px";stWidget.wrapper.style.marginLeft="auto";stWidget.wrapper.style.marginRight="auto";stWidget.wrapper.style.textAlign="left";stWidget.wrapper.style.position="fixed";if(document.all&&navigator.appVersion.indexOf("MSIE 6.")!=-1){stWidget.wrapper.style.left="300px";stWidget.wrapper.style.position="absolute"}}if(stWidget.options.autoPosition=="center"){if(document.all&&navigator.appVersion.indexOf("MSIE 7.")!=-1){stWidget.wrapper.style.left="500px"}else{stWidget.wrapper.style.left="10%"}stWidget.wrapper.style.right="10%";stWidget.wrapper.style.marginLeft="auto";stWidget.wrapper.style.marginRight="auto";stWidget.wrapper.style.position="fixed";topVal=(document.documentElement.clientHeight-parseFloat(stWidget.wrapper.offsetHeight)/2)/2;if(topVal>20){topVal=20}else{if(topVal<5){topVal=5}}stWidget.wrapper.style.top=topVal+"px";if(document.all&&navigator.appVersion.indexOf("MSIE 6.")!=-1){stWidget.wrapper.style.position="absolute"}}}stWidget.wrapper.style.visibility="visible";stWidget.mainstframe.style.visibility="visible"},stWidget.hideWidget=function(){if(stWidget.wrapper.style.visibility!=="hidden"){stWidget.wrapper.style.visibility="hidden"}if(stWidget.mainstframe.style.visibility!=="hidden"){stWidget.mainstframe.style.visibility="hidden"}if(switchTo5x){document.getElementById("stOverlay").style.display="none"}};stWidget.pageSize=function(){var e=[0,0,0,0];var b=0;var a=0;var d=0;var c=0;if(typeof(window.pageYOffset)=="number"){b=window.pageXOffset;a=window.pageYOffset}else{if(document.body&&(document.body.scrollLeft||document.body.scrollTop)){b=document.body.scrollLeft;a=document.body.scrollTop}else{if(document.documentElement&&(document.documentElement.scrollLeft||document.documentElement.scrollTop)){b=document.documentElement.scrollLeft;a=document.documentElement.scrollTop}}}if(window.innerWidth){d=window.innerWidth;c=window.innerHeight}else{if(document.documentElement.offsetWidth){d=document.documentElement.offsetWidth;c=document.documentElement.offsetHeight}}e={scrX:b,scrY:a,width:d,height:c};return e};stWidget.closeWidget=function(){if(st_showing==false){return false}st_showing=false;stWidget.widgetOpen=false;stWidget.wrapper.style.visibility="hidden";stWidget.mainstframe.style.visibility="hidden";stWidget.showEmbeds();stWidget.sendEvent("screen","home");if(switchTo5x){document.getElementById("stOverlay").style.display="none"}else{stWidget.wrapper.style.top="-999px";stWidget.wrapper.style.left="-999px"}};stWidget.hideEmbeds=function(){var b=document.getElementsByTagName("embed");for(var a=0;a<b.length;a++){b[a].style.visibility="hidden"}};stWidget.showEmbeds=function(){if(stWidget.options.embeds==true){return true}var b=document.getElementsByTagName("embed");for(var a=0;a<b.length;a++){b[a].style.visibility="visible"}};stWidget.sendEvent=function(a,d){var c="#widget/"+a+"="+d;try{window.frames.stLframe.location.replace(stWidget.frameUrl+c)}catch(b){}};stWidget.getOGTags=function(){var b=document.getElementsByTagName("meta");for(var a=0;a<b.length;a++){if(b[a].getAttribute("property")=="og:title"){stWidget.ogtitle=b[a].getAttribute("content")}else{if(b[a].getAttribute("property")=="og:type"){stWidget.ogtype=b[a].getAttribute("content")}else{if(b[a].getAttribute("property")=="og:url"){stWidget.ogurl=b[a].getAttribute("content")}else{if(b[a].getAttribute("property")=="og:image"){stWidget.ogimg=b[a].getAttribute("content")}else{if(b[a].getAttribute("property")=="og:description"){stWidget.ogdesc=b[a].getAttribute("content")}else{if(b[a].getAttribute("name")=="description"||b[a].getAttribute("name")=="Description"){stWidget.desc=b[a].getAttribute("content")}}}}}}}};function odjs(a,b){this.head=document.getElementsByTagName("head")[0];this.scriptSrc=a;this.script=document.createElement("script");this.script.setAttribute("type","text/javascript");this.script.setAttribute("src",this.scriptSrc);this.script.onload=b;this.script.onreadystatechange=function(){if(this.readyState=="loaded"){b()}};this.head.appendChild(this.script)}var jsonp={};jsonp.makeRequest=function(a){odjs(a,function(){})};function shareLog(a){if(typeof(pageTracker)!="undefined"&&pageTracker!==null){pageTracker._trackEvent("ShareThis",a)}else{if(typeof(_gaq)!="undefined"&&_gaq!==null){_gaq.push(["_trackEvent","ShareThis",a])}else{if(stButtons.publisherTracker!==null){stButtons.publisherTracker._trackEvent("ShareThis",a)}else{if(typeof(_gat)!="undefined"&&_gat!==null){if(typeof(stWidget.options.publisherGA)!="undefined"&&stWidget.options.publisherGA!=null){stButtons.publisherTracker=_gat._getTracker(stWidget.options.publisherGA);stButtons.publisherTracker._trackEvent("ShareThis",a)}}}}}}stButtons.onReady=function(){var g=document.getElementsByTagName("*");var b=[];var c=new RegExp(/sharethis_smartbuttons/);var a=false;for(var j=0;j<g.length;j++){if(typeof(g[j].className)=="string"&&g[j].className!=""){if(g[j].className.match(c)){a=true;break}}}if(a){var f=document.getElementsByTagName("head")[0];var d=["return=json","cb=stButtons.smartifyButtons"];d=d.join("&");var e=(("https:"==document.location.protocol)?"https://ws.":"http://wd.")+"sharethis.com/api/getRecentServices.php?"+d;var h=document.createElement("script");h.setAttribute("type","text/javascript");h.setAttribute("src",e);f.appendChild(h);setTimeout("stButtons.completeInit()",2000)}else{stButtons.completeInit()}};stButtons.completeInit=function(){if(!stButtons.goToInit){stButtons.goToInit=true;stWidget.getOGTags();document.body.appendChild(stWidget.wrapper);if(switchTo5x){document.body.appendChild(stWidget.overlay)}stButtons.makeButtons();stWidget.init()}};if(document.readyState=="complete"&&stLight.readyRun==false){stLight.onReady()}stButtons.goToInit=false;stButtons.widget=false;stButtons.widgetArray=[];stButtons.queue=[];stButtons.cbQueue=[];stButtons.cbVal=0;stButtons.queuePos=0;stButtons.counts=[];st_showing=false;stButtons.urlElements=[];stButtons.publisherTracker=null;if(typeof(window.addEventListener)!="undefined"){window.addEventListener("click",function(){stWidget.closeWidget()},false)}else{if(typeof(document.addEventListener)!="undefined"){document.addEventListener("click",function(){stWidget.closeWidget()},false)}else{if(typeof window.attachEvent!="undefined"){document.attachEvent("onclick",function(){stWidget.closeWidget()})}}};

stLight.options({publisher:'6ccf8cf7-faf4-4ae7-9288-1542a4af499a'});

/***************************** BUTTONS ****************************/
