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