/**
 * jQuery lightpop plugin
 * This jQuery plugin was inspired on jQuery lightBox plugin by Leandro Vieira Pinho (http://leandrovieira.com/projects/jquery/lightbox/)
 * @name jquery.lightpop-0.7.5.min.js
 * @author wokamoto - http://dogmap.jp
 * @version 0.7.5
 * @date February 17, 2009
 * @category jQuery plugin
 * @copyright (c) 2007-2009 wokamoto (dogmap.jp)
 * @license  Released under the GPL license (http://www.gnu.org/copyleft/gpl.html)
 * @example http://dogmap.jp/lightpop_sample/sample.html
 */
(function(a){a.browser=a.extend({chrome:/chrome/.test(navigator.userAgent.toLowerCase())},a.browser);a.fn.lightpop=function(J,A,y,c,f,s){y=y||"lightpop";c=c||"images/";f=f||c+y+"-";s=s||c+"icon-";J=a.extend(true,{overlayBgColor:"#000",overlayOpacity:0.7,contentFrameType:"border",contentBorder:"none",boxBorderSize:6,containerBorderSize:10,containerResizeSpeed:"normal",contentBgColor:"#FFF",imageBox:f+"box.gif",imageBorderL:f+"border-l.gif",imageBorderR:f+"border-r.gif",imageLoading:f+"ico-loading.gif",imageBtnPrev:f+"btn-prev.gif",imageBtnNext:f+"btn-next.gif",imageBtnClose:f+"btn-close.gif",imageBlank:f+"blank.gif",imageBtnPrevWidth:63,imageBtnNextWidth:63,imageBtnCloseWidth:66,txtImage:null,txtOf:"of",setLinkToTitle:false,keyToClose:"c",keyToPrev:"p",keyToNext:"n",flvplayer:"mediaplayer.swf",iconAdd:true,detailsEnabled:true,initSize:250,defaultLater:1500,grouping:true,Image:{enabled:true,icon:s+"image.png",param:{},size:new Array(0,0)},Contents:{enabled:true,icon:s+"contents.png",param:{},size:new Array(0,0),iframeEnabled:true},Video:{enabled:true,icon:s+"video.png",param:{},size:new Array(320,240)},YouTube:{enabled:true,icon:s+"youtube.png",param:{hl:"ja"},size:new Array(425,355)},Metacafe:{enabled:true,icon:s+"metacafe.png",param:{},size:new Array(400,345)},LiveLeak:{enabled:true,icon:s+"liveleak.png",param:{},size:new Array(450,370)},GoogleVideo:{enabled:true,icon:s+"googlevideo.png",param:{hl:"ja"},size:new Array(400,326)},ifilm:{enabled:true,icon:s+"ifilm.png",param:{},size:new Array(448,365)},Dailymotion:{enabled:true,icon:s+"dailymotion.png",param:{},size:new Array(420,330)},superdeluxe:{enabled:true,icon:s+"superdeluxe.png",param:{},size:new Array(400,350)},nicovideo:{enabled:true,icon:s+"nicovideo.png",param:{},size:new Array(312,176)}},J);if(J.imageMaxWidth||J.imageMaxHeight){J=a.extend(true,J,{Image:{size:new Array((J.imageMaxWidth||0),(J.imageMaxHeight||0))}})}var i=/^border$/i.test(J.contentFrameType);var E=new Array();E.length=0;var N=document,D=window;var O=N.body,L=N.documentElement,k=N.images;var l=a.browser.msie,C=a.browser.mozilla,B=a.browser.opera,m=a.browser.safari||a.browser.chrome;A=a.extend(true,{Image:{match:function(b){return(J.Image.enabled&&/\.(jpe?g|gif|png|bmp)$/i.test(b))},base:"/",defaultSize:J.Image.size,set:function(b){v(b,true)},preload:function(b){v(b,false)}},Video:{match:function(b){return(J.Video.enabled&&/\.(flv|swf|rm|mov|3gp|mp4|asf|avi|mpg|wmv)$/i.test(b))},defaultSize:J.Video.size,getInfo:function(T,e,U,V,b,S){S=S||T.replace(/\?.*$/,"");var w={};var W="true";var d=false;switch(S.toLowerCase().match(/\.(flv|swf|rm|mov|3gp|mp4|asf|avi|mpg|wmv)$/i)[1]){case"flv":U+=22;S=J.flvplayer+"?file="+S;case"swf":w={quality:"high",bgcolor:"#000"};S=u(S,e,U,w);break;case"rm":w={autostart:W,controls:"imagewindow,controlpanel"};S=R(S,"CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA","audio/x-pn-realaudio-plugin",e,U,w,"","",d,true);break;case"mov":case"mp4":case"3gp":U+=20;w={href:S,controller:"true",pluginspage:"http://www.apple.com/quicktime/download/",autoplay:W,bgcolor:"000000"};S=R(S,"02BF25D5-8C17-4B23-BC80-D3488ABDDC6B","video/quicktime",e,U,w,' codebase="http://www.apple.com/qtactivex/qtplugin.cab"',"",d,true);break;case"wmv":U+=20;w={AutoStart:W,URL:S,uiMode:"full"};d='src="'+S+'" name="player" width="'+e+'" height="'+U+'" type="application/x-mplayer2" pluginurl="http://www.microsoft.com/windows/windowsmedia" allowchangedisplaysize="1" autosize="1" displaysize="1" showcontrols="1" showstatusbar="0" autorewind="1" autostart="'+(W=="false"?"0":"1")+'"';S=R(S,"6BF52A52-394A-11d3-B153-00C04F79FAA6","application/x-oleobject",e,U,w,"","",d,false);break;default:U+=20;w={href:S,autostart:W,uiMode:"full"};S=R(S,"6BF52A52-394A-11d3-B153-00C04F79FAA6","application/x-oleobject",e,U,w,"","",d,false);break}return{content:S,width:e,height:U,later:Math.round(J.defaultLater*2/3)}}},YouTube:{match:function(b){return(J.YouTube.enabled&&/\.youtube\.com\/watch/i.test(b))},base:"http://www.youtube.com/v/",defaultSize:J.YouTube.size,getInfo:function(S,d,T,U,b,V,w){V=V||S.replace(/^.*\?v=(.*)$/i,"$1");w=w||b.base+V;var e={allowFullScreen:"true"};for(var W in U){if(/^fmt$/i.test(W)){w+="&ap=%2526fmt%3D"+U[W]}else{w+="&"+W+"="+U[W];if(!/^hl$/i.test(W)){e[W]=U[W]}}}w=u(w,d,T,e);return{content:w,width:d,height:T,later:J.defaultLater}}},Metacafe:{match:function(b){return(J.Metacafe.enabled&&/\.metacafe\.com\/watch/i.test(b))},base:"http://www.metacafe.com/fplayer/",defaultSize:J.Metacafe.size,getInfo:function(U,T,e,V,S,b,w){b=b||U.replace(/^.*\/watch\/([\d]+\/[^\/]*)\/?.*$/i,"$1");w=w||S.base+b+".swf";var d={};w=u(w,T,e,d,V);return{content:w,width:T,height:e,later:J.defaultLater}}},LiveLeak:{match:function(b){return(J.LiveLeak.enabled&&/\.liveleak\.com\/view/i.test(b))},base:"http://www.liveleak.com/player.swf?autostart=false&amp;token=",defaultSize:J.LiveLeak.size,getInfo:function(U,T,e,V,S,b,w){b=b||U.replace(/^.*\?i=(.*)$/i,"$1");w=w||S.base+b;var d={quality:"high"};w=u(w,T,e,d,V);return{content:w,width:T,height:e,later:J.defaultLater}}},GoogleVideo:{match:function(b){return(J.GoogleVideo.enabled&&/video\.google\.com\/videoplay/i.test(b))},base:"http://video.google.com/googleplayer.swf?docId=",defaultSize:J.GoogleVideo.size,getInfo:function(U,T,e,V,S,b,w){b=b||U.replace(/^.*\?docid=([a-z\d\-]+).*$/i,"$1");w=w||S.base+b;var d={flashvars:""};w=u(w,T,e,d,V);return{content:w,width:T,height:e,later:J.defaultLater}}},ifilm:{match:function(b){return(J.ifilm.enabled&&/\.ifilm\.com\/video/i.test(b))},base:"http://www.ifilm.com/efp",defaultSize:J.ifilm.size,getInfo:function(U,T,e,V,S,b,w){b=b||U.replace(/\?.*$/,"").replace(/^.*\/video\/([^\/]*)[\/]?$/i,"$1");w=w||S.base;w=u(w,T,e,d,V);var d={flashvars:"flvbaseclip="+b+"&",quality:"high",bgcolor:"000000"};return{content:w,width:T,height:e,later:J.defaultLater}}},Dailymotion:{match:function(b){return(J.Dailymotion.enabled&&/\.dailymotion\.com\/video/i.test(b))},base:"http://www.dailymotion.com/swf/",defaultSize:J.Dailymotion.size,getInfo:function(U,T,e,V,S,b,w){b=b||U.replace(/^.*\/video\/([^_]*).*$/i,"$1");w=w||S.base+b;var d={allowFullScreen:"true",allowScriptAccess:"always"};w=u(w,T,e,d,V);return{content:w,width:T,height:e,later:J.defaultLater}}},superdeluxe:{match:function(b){return(J.superdeluxe.enabled&&/\.superdeluxe\.com\/sd/i.test(b))},base:"http://i.cdn.turner.com/sdx/static/swf/share_vidplayer.swf",defaultSize:J.superdeluxe.size,getInfo:function(U,T,e,V,S,b,w){b=b||U.replace(/^.*\?id=(.*)$/i,"$1");w=w||S.base;var d={allowFullScreen:"true",FlashVars:"id="+b};w=u(w,T,e,d,V);return{content:w,width:T,height:e,later:J.defaultLater}}},nicovideo:{match:function(b){return(J.nicovideo.enabled&&/\.nicovideo\.jp\/watch/i.test(b))},base:"http://www.nicovideo.jp/watch/",defaultSize:J.nicovideo.size,getInfo:function(T,S,d,U,w,b,e){b=b||T.replace(/^.*\/watch\/(.*)$/i,"$1");e=e||w.base+b;e='<iframe width="'+S+'" height="'+d+'" src="http://www.nicovideo.jp/thumb/'+b+'" scrolling="no" style="border:solid 1px #CCC;" frameborder="0"><a href="'+e+'">'+w.tytle+"</iframe>";return{content:e,width:S,height:d,later:Math.round(J.defaultLater/3)}}},Contents:{match:function(b){return(J.Contents.enabled&&RegExp(D.location.host,"i").test(b)&&!/\.(jpe?g|gif|png|bmp)$/i.test(b))},defaultSize:J.Contents.size,set:function(e,b){var w=r(E[e].href);var d='width="'+w[0]+'" height="'+w[1]+'"';if(J.Contents.iframeEnabled){b="<iframe "+d+' src="'+E[e].href+'" scrolling="no" style="border:solid 1px #CCC;" frameborder="0"><a href="'+E[e].href+'">'+E[e].tytle+"</a></iframe>";E[e]=a.extend(E[e],{content:b,width:w[0],height:w[1],later:500});I(e)}else{a.get(E[e].href,function(T,S){b="<div "+d+">"+T.replace(/[\r\n]/g,"").replace(/.*<body.*?>(.*?)<\/body>.*$/,"$1").replace(/<script.*?>.*<\/script>/g,"")+"</div>";E[e]=a.extend(E[e],{content:b,width:w[0],height:w[1],later:500});I(e)})}},preload:function(b){},content_css:{textAlign:"left",lineHeight:"1.2em"}}},A);var j={overlay:"overlay",lightpop:y,box:y+"-box",content:y+"-content",nav:y+"-nav",data:y+"-data",details:y+"-details",loading:y+"-loading"};var K={overlay:"#"+j.overlay,lightpop:"#"+j.lightpop,box:"#"+j.box,content:"#"+j.content,nav:"#"+j.nav,data:"#"+j.data,details:"#"+j.details,loading:"#"+j.loading};var H=function(b,e){Q(J.imageBtnPrev,function(U,S,T){J.imageBtnPrevWidth=(S>0?S:J.imageBtnPrevWidth);Q(J.imageBtnNext,function(X,V,W){J.imageBtnNextWidth=(V>0?V:J.imageBtnNextWidth);Q(J.imageBtnClose,function(aa,Y,Z){J.imageBtnCloseWidth=(Y>0?Y:J.imageBtnCloseWidth);if(!i){Q(J.imageBox,function(ad,ab,ac){Q(J.imageBorderL,function(ag,ae,af){Q(J.imageBorderR,function(aj,ah,ai){J.contentBorder="none"})})})}})})});e=e||new Array();var d=0;b.filter("a").each(function(){var w=D.location;var V=a(this);if(!/^https?:/i.test(V.attr("href"))&&/^https?:/i.test(w.protocol)){V.attr("href",(/^\//i.test(V.attr("href"))?w.protocol+"//"+w.hostname+"/"+V.attr("href"):w.href.replace(/^(.*\/).*$/i,"$1")+V.attr("href").replace(/^\/?(.*)$/i,"$1")))}for(var T in A){var S=A[T];if(S.match(V.attr("href").replace(/\?.*$/,""))){var U=J[T];if(J.iconAdd&&V.children("img").length===0){V.css({background:"transparent url("+U.icon+") no-repeat scroll 1px 0pt",paddingLeft:"20px"})}E.push({type:T,href:V.attr("href"),title:V.attr("title")||V.html().replace(/<[^>]*>/ig,""),base:(S.base?S.base:"/")});V.unbind("click").click((function(W){return function(){t(W);return false}})(d));e.push(this);d++;break}}});return new a(e)};var t=function(V,U,w,T,e){J.grouping=(E.length>1?J.grouping:false);h(a("embed, object, select"),false);U=U||'<div id="'+j.content+'-wrap"><div id="'+j.content+'" /></div>';w=w||(J.detailsEnabled?'<div id="'+j.data+'-wrap"><div id="'+j.data+'"><div id="'+j.details+'"><div id="'+j.details+'-caption" /><div id="'+j.details+'-number" /></div><div id="'+j.data+'-nav"><a href="#" id="'+j.data+'-nav-close"><img src="'+J.imageBtnClose+'" /></a></div></div></div>':"");T=T||'<div id="'+j.nav+'"><a href="#" id="'+j.nav+'-prev" /><a href="#" id="'+j.nav+'-next" /></div><div id="'+j.loading+'"><a href="#" id="'+j.loading+'-link"><img src="'+J.imageLoading+'" /></a></div>';e=e||'<div id="'+j.overlay+'" /><div id="'+j.lightpop+'"><div id="'+j.box+'"><div id="'+j.box+'-inner">'+(i?U+"</div>"+w:'<div id="'+j.box+'-hd"><div id="'+j.box+'-hdc" /></div><div id="'+j.box+'-bd"><div id="'+j.box+'-bdc">'+U+w+'</div></div><div id="'+j.box+'-ft"><div id="'+j.box+'-ftc" /></div></div>')+T+"</div></div>";a("body").append(a(e).hide());var W=o();var b=g();var d=J.containerBorderSize;a(K.overlay+","+K.lightpop+","+K.nav+","+K.loading).css({position:"absolute"});a(K.box+","+K.data).css({position:"relative"});a(K.overlay).css({top:0,left:0,backgroundColor:J.overlayBgColor,opacity:J.overlayOpacity,width:W[0],height:W[1],zIndex:90});a(K.lightpop).css({top:b[1]+Math.round(W[3]/10),left:b[0],width:"100%",height:0,overflow:"visible",textAlign:"center",lineHeight:0,border:"none",zIndex:100});a(K.lightpop+" a img").css({border:"none"});a(K.box).css({width:J.initSize,height:J.initSize,top:0,margin:"0 auto",padding:0,backgroundColor:J.contentBgColor,border:J.contentBorder,overflow:(i?"hidden":"visible")});a(K.box+"-inner").css({width:J.initSize,height:J.initSize,backgroundColor:"transparent",margin:"0 auto",padding:(i?d:0),overflow:(i?"hidden":"visible")});a(K.content+"-wrap").css({backgroundColor:"transparent"});a(K.content).css({margin:(i?0:"0 auto"),padding:(i?0:d+"px 0"),zIndex:110});if(!i){var S=J.boxBorderSize;x(false).css({position:"relative"}).hide();a(K.box+"-hd,"+K.box+"-hdc").css({height:S,top:0});a(K.box+"-ft,"+K.box+"-ftc").css({height:S,bottom:0});a(K.box+"-hd,"+K.box+"-ft").css({margin:"0 "+S+"px 0 0"});a(K.box+"-hdc,"+K.box+"-ftc").css({margin:"0 "+S*-1+"px 0 "+S+"px"})}a(K.nav).css({top:0,left:0,height:"10px",width:"100%",padding:0,margin:(i?"0":J.boxBorderSize+"px")+" auto",zIndex:10});a(K.nav+" a").css({display:"block",height:"100%",zoom:1,margin:(i?0:"0 "+J.boxBorderSize+"px"),outline:"none"});a(K.nav+"-prev").css(J.grouping?{width:J.imageBtnPrevWidth,left:0,styleFloat:"left"}:{display:"none"});a(K.nav+"-next").css(J.grouping?{width:J.imageBtnNextWidth,right:0,styleFloat:"right"}:{display:"none"});a(K.loading).css({top:"40%",left:0,height:"20%",width:"100%",margin:"0 auto",textAlign:"center",lineHeight:0});if(J.detailsEnabled){a(K.data+"-wrap").css({font:"10px Verdana, Helvetica, sans-serif",backgroundColor:J.contentBgColor,lineHeight:"1.4em",width:"100%",margin:"0 auto",padding:"0 "+d+"px 0",overflow:"hidden"}).hide();a(K.data).css({padding:"0 "+d+"px",color:"#f5f5f5",left:0,bottom:0});a(K.details).css({width:"70%",styleFloat:"left",textAlign:"left"});a(K.details+"-caption").css({styleFloat:"left","font-weight":"normal",width:"100%"});a(K.details+"-number").css({styleFloat:"left",clear:"left",width:"100%","padding-bottom":"1em"});a(K.data+"-nav-close").css({styleFloat:"right",width:J.imageBtnCloseWidth,padding:".35em 0"})}a(K.overlay).fadeIn(J.containerResizeSpeed,function(){a(K.lightpop).show()});a(K.overlay+","+K.loading+"-link,"+K.data+"-nav-close").click(function(){z();return false});P(true);q(V)};var q=function(b){h(a(K.data+","+K.details+","+K.details+"-caption,"+K.details+"-number,"+K.data+"-nav-close"),false);a(K.nav+","+K.nav+"-prev,"+K.nav+"-next").hide();a(K.content).hide().children().remove();a(K.loading+","+K.box+","+K.box+"-inner").show();x(false);if(J.detailsEnabled&&!i&&m){a(K.data+"-wrap").height("auto")}I(b)};var I=function(b){(E[b].content?function(d){a(K.content).append(a(E[d].content));setTimeout(function(){M(d)},E[d].later)}:(A[E[b].type].set?A[E[b].type].set:(function(d){n(d);I(d)})))(b)};var G=function(e,d,b,w){if(J.detailsEnabled){w=(w<28?28:w);b+=w}(i?(function(S){a(K.box).animate({width:d,height:b},"fast",function(){h(S,true)})}):(function(S){if(J.detailsEnabled&&m){a(K.data+"-wrap").height(w)}h(S,true)}))(e)};var M=function(V){var e=J.containerBorderSize,U=J.boxBorderSize,b=E[V],S=o(),T=g();var w=b.width+(e+(i?0:U))*2,d=b.height+e*2;a(K.lightpop).animate({top:T[1]+Math.round(S[3]/10),left:T[0]},J.containerResizeSpeed,function(){a(K.box).animate({width:w,height:d},J.containerResizeSpeed,function(){var W=A[b.type];a(K.box+"-inner").css({width:(i?b.width:w),height:b.height});a(K.content).css({width:b.width,height:b.height});if(J.detailsEnabled){a(K.data+"-wrap").css({width:b.width})}if(W.content_css){a(K.content).children().css(W.content_css)}a(K.loading).hide();if(/<object.*>/i.test(b.content)){a(K.content).show()}else{a(K.content).fadeIn()}x(true);a(K.details+"-caption").html((J.setLinkToTitle?'<a href="'+b.href+'" title="'+b.title+'">'+b.title+"</a>":b.title));a(K.details+"-number").html((J.txtImage||b.type)+(J.grouping&&E.length>1?" "+(V+1)+" "+J.txtOf+" "+E.length:""));var X=h(a(K.data+","+K.details+","+K.details+"-caption,"+K.details+"-number,"+K.data+"-nav-close"),false).show();(J.detailsEnabled?function(aa,Y,Z){a(K.data+"-wrap").slideDown("fast",function(){G(aa,Y,Z,(!m?a(this).height():this.scrollHeight))})}:function(aa,Y,Z){G(aa,Y,Z)})(X,w,d);a(K.nav).css({width:w}).show(function(){if(J.grouping){a(K.nav+"-prev,"+K.nav+"-next").css({height:Math.round(d/3),background:"transparent url("+J.imageBlank+") no-repeat"}).unbind();if(V!=0){a(K.nav+"-prev").hover(function(){a(this).css({background:"url("+J.imageBtnPrev+") left 30% no-repeat"})},function(){a(this).css({background:"transparent url("+J.imageBlank+") no-repeat"})}).show().click((function(Y){return function(){q(Y);return false}})(V-1))}if(V!=(E.length-1)){a(K.nav+"-next").hover(function(){a(this).css({background:"url("+J.imageBtnNext+") right 30% no-repeat"})},function(){a(this).css({background:"transparent url("+J.imageBlank+") no-repeat"})}).show().click((function(Y){return function(){q(Y);return false}})(V+1))}}F(true,V)});if(E.length-1>V){p(V+1)}if(V>0){p(V-1)}})})};var p=function(b){if(!E[b].content){(A[E[b].type].preload?A[E[b].type].preload:(function(d){n(d)}))(b)}};var r=function(e,d,U){var T=0,b=0;var w=e.toLowerCase().replace(/[\r\n]/g,"").replace(/["']/g,"").match(/(width|height)=(\d+)/ig);if(w){a.each(w,function(){if(/^width=\d+$/i.test(this)){T=Number(this.replace(/^width=(\d+)$/,"$1"))}if(/^height=\d+$/i.test(this)){b=Number(this.replace(/^height=(\d+)$/,"$1"))}})}if(T===0||b===0){if(d){T=d[0];b=d[1]}else{var S=o();T=S[0]/4;b=S[1]/4}}if(U){if(U[0]!=0&&T>U[0]){b=b*(U[0]/T);T=U[0]}if(U[1]!=0&&b>U[1]){T=T*(U[1]/b);b=U[1]}}return new Array(Math.round(T),Math.round(b))};var n=function(W,V,S){var d,U={},e=E[W];var b=J[e.type],w=A[e.type],T=e.href.replace(/&.*$/i,"");if(/\?.*$/.test(e.href)){var X=e.href.replace(/^.*\?/,"").split("&");if(X.length>0){a.each(X,function(){var Z,Y=this.toString();if(!/^(width|height|v|i|docid|id)\=.*$/i.test(Y)){Z=(Y).match(/^([^=]*)=(.*)$/i);if(Z.length>2){U[Z[1]]=Z[2]}}})}}U=a.extend(U,b.param);d=r(e.href,w.defaultSize);E[W]=a.extend(e,w.getInfo(T,d[0],d[1],U,e))};var u=function(d,S,b,U,T,w){if(typeof T==="object"){a.each(T,function(V){d+=(d.indexOf(V+"=")<0?(d.indexOf("?")<0?"?":"&")+V+"="+this:"")})}var e={movie:d,wmode:"transparent"};U=(U?a.extend(e,U):e);w=w||'<object width="'+S+'" height="'+b+'" data="'+d+'" wmode="'+U.wmode+'" type="application/x-shockwave-flash">';a.each(U,function(V){w+='<param name="'+V+'" value="'+this+'" />'});w+="</object>";return w};var R=function(d,T,Y,e,Z,S,aa,b,X,W){var V="",w="",U={src:d,width:e,height:Z,type:Y};S=(S?a.extend(U,S):U);V+='<object width="'+e+'" height="'+Z+'"'+(T!=" "?'classid="clsid:'+T+'"':"")+' type="'+Y+'" '+b+">";a.each(S,function(ab){V+='<param name="'+ab+'" value="'+this+'" />'});w+="<embed "+(X!==false?X:'width="'+e+'" height="'+Z+'"');if(X===false){a.each(S,function(ab){w+=" "+ab+'="'+this+'"'})}w+=">"+(W?'<noembed><a href="'+d+'">'+d+"</a></noembed>":"")+"</embed>";V+=w+"</object>";return V};var x=function(e,d,b){if(!i){d=a(K.box+"-hd, "+K.box+"-hdc, "+K.box+"-bd, "+K.box+"-bdc, "+K.box+"-ft, "+K.box+"-ftc");b="transparent";if(e){a(K.box).css({backgroundColor:b});a(K.box+"-hd").css({background:b+" url("+J.imageBox+") left top no-repeat"});a(K.box+"-hdc").css({background:b+" url("+J.imageBox+") right top no-repeat"});a(K.box+"-bd").css({background:J.contentBgColor+" url("+J.imageBorderL+") left top repeat-y"});a(K.box+"-bdc").css({background:b+" url("+J.imageBorderR+") right top repeat-y"});a(K.box+"-ft").css({background:b+" url("+J.imageBox+") left bottom no-repeat"});a(K.box+"-ftc").css({background:b+" url("+J.imageBox+") right bottom no-repeat"});d.show()}else{a(K.box).css({backgroundColor:J.contentBgColor});d.css({background:b})}return d}};var v=function(d,b){Q(E[d].href,(function(w,e){return function(U,T,S){var V=r(U,new Array(T,S),J.Image.size);E[w]=a.extend(E[w],{content:'<img src="'+U.replace(/\?.*$/,"")+'" width="'+V[0]+'" height="'+V[1]+'" />',width:V[0],height:V[1],later:(l?250:100)});if(e){I(w)}}})(d,b))};var Q=function(b,V,T,e,W){V=V||function(){};T=T||function(){};e=e||10;W=W||2000;for(var d=0,U=k.length;d<U;++d){if(k[d].src===b&&k[d].complete){V(b,k[d].width,k[d].height);return}}var w=new Image(),S=0;w.finish=false;w.onabort=w.onerror=function(){if(w.finish){return}w.finish=true;T(b)};w.onload=function(){w.finish=true;if(B&&!w.complete){T(b);return}V(b,w.width,w.height)};w.src=b;if(!w.finish&&W){setTimeout(function(){if(w.finish){return}if(w.complete){w.finish=true;if(w.width){return}T(b);return}if((S+=e)>W){w.finish=true;T(b);return}setTimeout(arguments.callee,e)},0)}};var h=function(d,b){return d.css({visibility:(b?"visible":"hidden")})};var F=function(b,d){a(N).unbind("keydown");if(b){a(N).keydown(function(S){var e=(S||event).keyCode;var w=(S?S.DOM_VK_ESCAPE:27);var T=String.fromCharCode(e).toLowerCase();if((T==J.keyToClose)||(T=="x")||(e==w)){z()}else{if(J.grouping){if(((T==J.keyToPrev)||(e==37))&&d!=0){q(d-1)}else{if(((T==J.keyToNext)||(e==39))&&d!=(E.length-1)){q(d+1)}}}}})}};var P=function(b){a(D).unbind("resize");if(b){a(D).resize(function(d,e){d=o();e=g();a(K.overlay).css({width:d[0],height:d[1]});a(K.lightpop).css({top:e[1]+Math.round(d[3]/10),left:e[0]})})}};var o=function(b,e,d,S){var w=!(N.compatMode&&N.compatMode!=="BackCompat");b=(L&&L.scrollWidth?L:O).scrollWidth;e=(L&&L.scrollHeight?L:O).scrollHeight;d=(w?O:L).clientWidth;S=(w?O:L).clientHeight;b=(b<d?b:d);e=(e<S?S:e);return new Array(b,e,d,S)};var g=function(){return new Array((L&&L.scrollLeft?L:O).scrollLeft,(L&&L.scrollTop?L:O).scrollTop)};var z=function(){h(a("object",a(K.lightpop)),false).remove();a(K.lightpop).height(a(K.box).height()).slideUp(function(){a(this).remove();a(K.overlay).fadeOut(function(){a(this).remove();h(a("embed, object, select"),true)})});F(false);P(false)};return H(this)}})(jQuery);