function fbox_engine(){if(typeof (fbox_conf)!="function"){return;}var _1,fbox_nbsp_txt;var _2,fbox_max_txt,fbox_min_txt;var _3,fbox_next_txt;var _4=0;var _5;var _6,fbox_world;var _7,fbox_progress,fbox_progress_img;var _8,fbox_content,fbox_spacer;var _9,fbox_title;var _a,fbox_close_a,fbox_resize_a;var _b,fbox_prev_a,fbox_next_a;var _c;var _d;var _e=0;var _f=0;var _10=0;var _11=0;var _12=false;var _13=false;var _14;var _15=null;var _16="";addEvent(window,"load",init_fbox);function init_fbox(){if(getElem("fbox_world")){return;}_5=null;try{if(window.XMLHttpRequest){_5=new XMLHttpRequest();}else{if(window.ActiveXObject){_5=new ActiveXObject("Microsoft.XMLHTTP");}}}catch(e){}var cst=new fbox_conf();_1=cst.fbox_progress_src;_2=cst.fbox_close_txt;_3=cst.fbox_prev_txt;fbox_next_txt=cst.fbox_next_txt;fbox_max_txt=cst.fbox_max_txt;fbox_min_txt=cst.fbox_min_txt;fbox_nbsp_txt="";for(var i=0;i<cst.fbox_nbsp_count;i++){fbox_nbsp_txt+="&nbsp;";}var _19="<div id=\"fbox_bg\" style=\"display:none;\"></div>"+"<div id=\"fbox_progress\" style=\"display:none;\">"+"<img id=\"fbox_progress_img\" border=\"0\" src=\""+_1+"\" />"+"</div>"+"<div id=\"fbox_fg\" display=\"none\">"+"<div id=\"fbox_fg_inner\">"+"<div id=\"fbox_content\"></div>"+"<div id=\"fbox_spacer\"></div>"+"<table id=\"fbox_bar\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>"+"<div id=\"fbox_sys\">"+"<nobr>"+"<a id=\"fbox_resize_a\" href=\"javascript:void(null);\" >"+fbox_max_txt+"</a>"+"<span id=\"fbox_resize_nbsp\" >"+fbox_nbsp_txt+"</span>"+"<a id=\"fbox_close_a\" href=\"javascript:void(null);\" >"+"<img id=\"fbox_close_img\" border=\"0\" src=\""+_2+"\" />"+"</a>"+"</nobr>"+"</div>"+"<div id=\"fbox_title\">&nbsp;</div>"+"<div id=\"fbox_navig\">"+"<nobr>"+"<a id=\"fbox_prev_a\" href=\"javascript:void(null);\" >"+_3+"</a>"+fbox_nbsp_txt+"<a id=\"fbox_next_a\" href=\"javascript:void(null);\" >"+fbox_next_txt+"</a>"+"</nobr>"+"</div>"+"</td></tr></table>"+"</div>"+"</div>";fbox_world=document.createElement("div");fbox_world.setAttribute("id","fbox_world");fbox_world.innerHTML=_19;_6=document.getElementsByTagName("body")[0];_6.appendChild(fbox_world);_16=typeof (_6.style.cssText)!="undefined"?_6.style.cssText:_6.getAttribute("style");_7=getElem("fbox_bg");fbox_progress=getElem("fbox_progress");fbox_progress_img=getElem("fbox_progress_img");_8=getElem("fbox_fg");fbox_content=getElem("fbox_content");fbox_spacer=getElem("fbox_spacer");_9=getElem("fbox_bar");fbox_title=getElem("fbox_title");_a=getElem("fbox_sys");fbox_close_a=getElem("fbox_close_a");fbox_resize_a=getElem("fbox_resize_a");_b=getElem("fbox_navig");fbox_prev_a=getElem("fbox_prev_a");fbox_next_a=getElem("fbox_next_a");_c=getElem("fbox_fg_inner");_d=getElem("fbox_resize_nbsp");fbox_close_a.onclick=hideFbox;blending_fg=new blendingTransition(_8);blending_bg=new blendingTransition(_7);fbox_content.style.visibility="hidden";_8.style.width=100+"px";fbox_content.style.width="auto";_8.style.left=-200+"px";_8.style.top=-200+"px";_8.style.display="";_14=fbox_content.offsetWidth<100;_8.style.display="none";fbox_content.style.visibility="visible";_8.style.left=0+"px";_8.style.top=0+"px";var _1a=new Image();_1a.onload=function(){this.onload=null;fbox_progress_img.style.width=this.width+"px";fbox_progress_img.style.height=this.height+"px";};_1a.src=_1;var _1b=new Array();function fbox_kind(_1c){var _1d=this;this.tagLink=_1c.parentNode;this.title=_1c.getAttribute("title");var src=trim(_1c.getAttribute("src"));if(!src){src=trim(this.tagLink.getAttribute("href"));}this.src=src;this.type=3;var _1f=trim(_1c.getAttribute("type")).toLowerCase();switch(_1f){case "image":this.type=0;break;case "inline":this.type=1;break;case "ajax":this.type=2;break;case "iframe":this.type=3;break;default:if(src.indexOf("#")>=0){this.type=1;break;}var dot=src.lastIndexOf(".");if(dot<1){break;}var ext=src.substr(dot+1,src.length).toLowerCase();if(ext=="jpg"||ext=="jpeg"||ext=="png"||ext=="gif"){this.type=0;}}this.tagContent=null;if(this.type==1){var _22=src.substr(src.indexOf("#")+1,1000);this.tagContent=getElem(_22);if(this.tagContent){var _23=this.tagContent.getElementsByTagName("select");for(var i=0;i<_23.length;i++){_23[i].setAttribute("fbox-marker","fbox-marker");}}else{this.type=-1;}}if(this.type==2&&!_5){this.type=-1;}this.objImg=null;this.imgType=-1;this.exactImgWidth=0;this.exactImgHeight=0;this.imgState=-1;this.width=_1c.getAttribute("width")-0;this.height=_1c.getAttribute("height")-0;if(this.type==0){this.imgType=0;if(this.width&&this.width>0){this.imgType+=1;}else{this.width=200;}if(this.height&&this.height>0){this.imgType+=2;}else{this.height=150;}this.imgState=this.imgType?1:0;if(!trim(this.title)){var _25=this.tagLink.getElementsByTagName("img");if(_25[0]){var _26=_25[0].getAttribute("title");if(trim(_26)){this.title=_26;}}}}else{if(!this.width){this.width=230;}if(!this.height){this.height=160;}}this.next=null;this.prev=null;var _27=trim(_1c.getAttribute("name")).toLowerCase();if(_27&&this.type!=-1){if(_1b[_27]){var n=_1b[_27].length;this.prev=_1b[_27][n-1];this.prev.next=this;_1b[_27][n]=this;}else{_1b[_27]=new Array();_1b[_27][0]=this;}}function ready(){_15=_1d;showFbox();return false;}this.tagLink.onclick=this.type==-1?nope:ready;}var _29=document.getElementsByTagName("span");for(var i=0;i<_29.length;i++){var _2b=_29[i];if(_2b.className=="frontbox"&&_2b.parentNode.nodeName.toLowerCase()=="a"){new fbox_kind(_2b);}}}function nope(){return false;}function trim(str){if(!str){return "";}str=str.replace(/^\s*(\S*(\s+\S+)*)\s*$/,"$1");return (str);}function blendingTransition(_2d){var _2e=null;var _2f=0;var _30=0;var _31=null;this.halt=halt;this.animate=animate;this.redisplay=redisplay;function majorTask(){if((_30>0&&_2f<_31)||(_30<0&&_2f>_31)){setBlend(_2f);_2f+=_30;return true;}redisplay();return false;}function setBlend(_32){if(_32>=100){_2d.style.opacity="";_2d.style.filter="";_2d.style.display="";}else{if(_32<=0){_2d.style.display="none";_2d.style.opacity=0;_2d.style.filter="alpha(opacity=0)";}else{_2d.style.opacity=_32/100;_2d.style.filter="alpha(opacity="+_32+")";_2d.style.display="";}}}function redisplay(){if(_30==0){halt();}else{if((_30>0&&_2f>=_31)||(_30<0&&_2f<=_31)){halt();_2f=_31;}}setBlend(_2f);}function halt(val){var _34=_2e?true:false;if(_34){clearInterval(_2e);_2e=null;}_30=0;val=val-0;if(!isNaN(val)){_2f=val;setBlend(val);}return _34;}function animate(_35,_36,_37,_38){if(!halt()){_2f=_35;}_31=_36;_30=_37;if(majorTask()){_2e=window.setInterval(majorTask,_38);}}}function adjustBg(){var _39=new getPageSize();var _3a=new getScrollPos();_7.style.width=_39.width+"px";_7.style.height=_39.height+"px";_7.style.left=_3a.left+"px";_7.style.top=_3a.top+"px";blending_bg.redisplay();}function showBg(){blending_bg.halt(0);adjustBg();setSelectVisibility("hidden");blending_bg.animate(0,77,10,70);_4=_4|2;}function setSelectVisibility(v){var _3c=document.getElementsByTagName("select");for(var i=0;i<_3c.length;i++){var _3e=_3c[i];if(_3e.getAttribute("fbox-marker")!="fbox-marker"){_3e.style.visibility=v;}}}function hideBg(){_4=_4&(~2);blending_bg.halt(0);setSelectVisibility("visible");}function showProgress(){fbox_progress.style.display="";centerProgress();fbox_progress.onclick=function(){_4=_4|1;hideFbox();};_4=_4|4;}function hideProgress(){_4=_4&(~4);fbox_progress.style.display="none";fbox_progress.onclick=null;}function adjustFg(_3f){var _40=_15.width;var _41=_15.height;var _42=trim(_15.title)?true:false;var _43=_15.next||_15.prev?true:false;var _44=false;if(!_3f){_44=_42||_43;}else{if(_3f==1){_44=true;}}if(_44&&_40<200){_40=200;}if(_44){fbox_spacer.style.visibility="visible";fbox_spacer.style.display="";_9.style.visibility="visible";_9.style.display="";if(_42){fbox_title.style.styleFloat=fbox_title.style.cssFloat="left";fbox_title.style.visibility="visible";fbox_title.style.height="auto";fbox_title.style.overflow="visible";_b.style.marginTop=3+"px";}else{fbox_title.style.styleFloat=fbox_title.style.cssFloat="right";fbox_title.style.visibility="hidden";fbox_title.style.height=1+"px";fbox_title.style.overflow="hidden";_b.style.marginTop=0+"px";}}else{fbox_spacer.style.visibility="hidden";fbox_spacer.style.display="none";_9.style.visibility="hidden";_9.style.display="none";}if(_43){if(_15.prev){fbox_prev_a.style.visibility="visible";}else{fbox_prev_a.style.visibility="hidden";}if(_15.next){fbox_next_a.style.visibility="visible";}else{fbox_next_a.style.visibility="hidden";}_b.style.visibility="visible";_b.style.display="";}else{_b.style.visibility="hidden";_b.style.display="none";}if(_14){_8.style.width=(_40+18)+"px";fbox_content.style.width=(_40+6)+"px";fbox_content.style.height=(_41+6)+"px";}else{_8.style.width=(_40+6)+"px";fbox_content.style.width=_40+"px";fbox_content.style.height=_41+"px";}if(_44){fbox_spacer.style.width=(_40+6)+"px";_9.style.width=(_40+6)+"px";fbox_title.style.width="auto";_8.style.height="auto";_9.style.height="auto";_8.style.display="";var w1=_a.offsetWidth;var w2=fbox_title.offsetWidth;_8.style.display="none";w1=_40-w1-25;var w=w1<=190?_40-10:w1>w2?w2:w1;fbox_title.style.width=w+"px";_8.style.display="";var h=_8.offsetHeight;_8.style.display="none";h=h-12;_8.style.height=h+"px";_9.style.height=h-_41-15+"px";}else{if(_14){_8.style.height=(_41+18)+"px";}else{_8.style.height=(_41+6)+"px";}}centerFg();}function adjustImage(){var _49=_15.objImg;var _4a=0;switch(_15.imgType){case 0:var _4b=new getPageSize();with(Math){var x=max(_4b.width-125,200);var y=max(_4b.height-125,200);var _4e=max(1,max(_15.exactImgWidth/x,_15.exactImgHeight/y));}if(_4e>1){fbox_resize_a.style.visibility="visible";fbox_resize_a.style.display="";_d.style.visibility="visible";_d.style.display="";_4a=1;}else{fbox_resize_a.style.visibility="hidden";fbox_resize_a.style.display="none";_d.style.visibility="hidden";_d.style.display="none";}if(_15.imgState==0){fbox_resize_a.innerHTML=fbox_max_txt;_15.width=_49.width=Math.round(_15.exactImgWidth/_4e);_15.height=_49.height=Math.round(_15.exactImgHeight/_4e);}else{fbox_resize_a.innerHTML=fbox_min_txt;_15.width=_49.width=_15.exactImgWidth;_15.height=_49.height=_15.exactImgHeight;}break;case 1:_15.height=_49.height=Math.round(_15.exactImgHeight*_15.width/_15.exactImgWidth);_49.width=_15.width;break;case 2:_15.width=_49.width=Math.round(_15.exactImgWidth*_15.height/_15.exactImgHeight);_49.height=_15.height;break;case 3:_49.width=_15.width;_49.height=_15.height;}adjustFg(_4a);}function toggleImgState(){if(((_4&8)==8)&&(_15.imgType==0)){_15.imgState=_15.imgState?0:1;setContent(false);adjustImage();setContent(true);}return false;}function showNext(){if(_15.next){_15=_15.next;showFbox();}return false;}function showPrev(){if(_15.prev){_15=_15.prev;showFbox();}return false;}function showFbox(){var src=_15.src;_6.style.width="auto";_6.style.height="auto";_12=_13=false;_10=0;_11=0;fbox_resize_a.style.visibility="hidden";fbox_resize_a.style.display="none";_d.style.visibility="hidden";_d.style.display="none";setContent(false);fbox_title.innerHTML=trim(_15.title)?_15.title:"&nbsp;";blending_fg.halt(0);_4=_4&2;if((_4&2)==0){showBg();}adjustOnResizeTime();adjustOnScrollTime();addEvent(window,"scroll",adjustOnScrollPos);if(_15.type==0||_15.type==2){showProgress();}if(_15.type==0){fbox_content.onclick=hideFbox;fbox_resize_a.onclick=toggleImgState;}else{fbox_content.onclick=null;fbox_resize_a.onclick=nope;}fbox_prev_a.onclick=_15.prev?showPrev:nope;fbox_next_a.onclick=_15.next?showNext:nope;switch(_15.type){case 0:var _50=new Image();_15.objImg=_50;_50.onload=function(){_15.objImg.onload=null;if((_4&1)!=1){hideProgress();_15.exactImgWidth=_15.objImg.width;_15.exactImgHeight=_15.objImg.height;adjustImage();setContent(true);blending_fg.animate(0,100,10,30);_4=_4|8;}};_50.src=src;break;case 1:adjustFg(1);var _51=_15.tagContent.innerHTML;setContent(_51);blending_fg.animate(0,100,10,30);_4=_4|8;break;case 2:try{_5.open("GET",src,true);}catch(e){_15.tagLink.onclick=nope;hideFbox();break;}_5.onreadystatechange=function(){if((_4&1)==1){_5.onreadystatechange=nope;_5.abort();}else{if(_5.readyState==4){_5.onreadystatechange=nope;if(_5.status==200||!_5.status){hideProgress();adjustFg(1);var _52=_5.responseText;setContent(_52);blending_fg.animate(0,100,10,30);_4=_4|8;}else{_15.tagLink.onclick=nope;hideFbox();}}}};_5.send(null);break;case 3:adjustFg(1);setContent(true);blending_fg.animate(0,100,10,30);_4=_4|8;}}function adjustOnScrollTime(){function majorTask(){if((_4&8)==8){centerFg();}if((_4&2)==2){adjustBg();}if((_4&4)==4){centerProgress();}if((_4&1)==1){hideFbox();}else{var now=new Date();var _54=now.getTime();_f=_54;addEvent(window,"scroll",adjustOnScrollTime);var _55=new getScrollPos();_10=_55.left;_11=_55.top;}}removeEvent(window,"scroll",adjustOnScrollTime);var now=new Date();var _57=now.getTime()-_f;if(_57>=200){majorTask();}else{window.setTimeout(majorTask,200-_57);}}function adjustOnScrollPos(){var _58=new getScrollPos();if(Math.abs(_58.left-_10)>50||Math.abs(_58.top-_11>50)){if((_4&8)==8){centerFg();}if((_4&2)==2){adjustBg();}if((_4&4)==4){centerProgress();}_10=_58.left;_11=_58.top;var now=new Date();var _5a=now.getTime();_f=_5a;}}function adjustOnResizeTime(){function majorTask(){_7.style.display="none";_8.style.display="none";if((_4&8)==8){if(_15.imgType==0){setContent(false);adjustImage();setContent(true);}else{centerFg();}}if((_4&2)==2){adjustBg();}if((_4&4)==4){centerProgress();}if((_4&1)==1){hideFbox();}else{var now=new Date();var _5c=now.getTime();_f=_e=_5c;addEvent(window,"resize",adjustOnResizeTime);var _5d=new getScrollPos();_10=_5d.left;_11=_5d.top;}}removeEvent(window,"resize",adjustOnResizeTime);var now=new Date();var _5f=now.getTime()-_e;if(_5f>=200){majorTask();}else{window.setTimeout(majorTask,200-_5f);}}function hideFbox(){_4=_4|1;blending_fg.halt(0);if(_5){_5.onreadystatechange=nope;}if(_15.objImg){_15.objImg.onload=null;}if((_4&4)==4){hideProgress();}_4=_4&(~8);if((_4&2)==2){hideBg();}_8.style.display="none";setContent(false);removeEvent(window,"resize",adjustOnResizeTime);removeEvent(window,"scroll",adjustOnScrollTime);removeEvent(window,"scroll",adjustOnScrollPos);if(typeof (_6.style.cssText)!="undefined"){_6.style.cssText=_16;}else{_6.setAttribute("style",_16);}}function centerProgress(){var _60=new getScrollPos();var _61=new getPageSize();var _62=(_61.width-fbox_progress.offsetWidth)>>1;var top=(_61.height-fbox_progress.offsetHeight)>>1;fbox_progress.style.left=_60.left+_62+"px";fbox_progress.style.top=_60.top+top+"px";}function centerFg(){var _64=new getScrollPos();var _65=new getPageSize();_8.style.display="";var _66=(_65.width-_8.offsetWidth)>>1;var top=(_65.height-_8.offsetHeight)>>1;blending_fg.redisplay();if(_66<=0){if(!_12){_12=true;_66=_64.left+_66;if(_66<0){_66=0;}_8.style.left=_66+"px";}}else{_12=false;_8.style.left=_64.left+_66+"px";}if(top<=0){if(!_13){_13=true;top=_64.top+top;if(top<0){top=0;}_8.style.top=top+"px";}}else{_13=false;_8.style.top=_64.top+top+"px";}}function getScrollPos(){var _68=document.documentElement;this.left=window.pageXOffset||(_68&&_68.scrollLeft)||document.body.scrollLeft;this.top=window.pageYOffset||(_68&&_68.scrollTop)||document.body.scrollTop;}function getPageSize(){var _69=document.documentElement;var _6a=document.body;var _6b,val2h,val3h;var _6c,val2w,val3w;var w=0,h=0;_6b=_69?_69.clientHeight:0;val2h=_6a.clientHeight?_6a.clientHeight:0;val3h=window.innerHeight?window.innerHeight:0;_6c=_69?_69.clientWidth:0;val2w=_6a.clientWidth?_6a.clientWidth:0;val3w=window.innerWidth?window.innerWidth:0;if(_6b&&val2h&&val3h){if(_6b==val2h){w=val3w;h=val3h;}else{if(val2h<_6b){var tmp=_6b;_6b=val2h;val2h=tmp;}if(val2w<_6c){var tmp=_6c;_6c=val2w;val2w=tmp;}h=val2h<=val3h?val2h:_6b;w=val2w<=val3w?val2w:_6c;}}else{if(_6b){w=_6c;h=_6b;}else{w=val2w;h=val2h;}}this.width=w;this.height=h;}function setContent(str){if(!str){fbox_content.innerHTML="";fbox_content.style.overflow="hidden";return;}if(_15.type==0){str="<a href=\"javascript:void(null);\" style=\"font-size:8px;\" >"+"<img id=\"fbox_content_img\" src=\""+_15.src+"\" border=\"0\" />"+"</a>";}else{if(_15.type==3){str="<iframe src=\""+_15.src+"\" id=\"fbox_content_iframe\" frameborder=\"0\" ></iframe>";}else{if(typeof (str)!="string"){str="";}}}fbox_content.innerHTML=str;fbox_content.style.overflow="auto";var _71=null;if(_15.type==0){_71=getElem("fbox_content_img");}else{if(_15.type==3){_71=getElem("fbox_content_iframe");}else{return;}}_71.style.width=_15.width+"px";_71.style.height=_15.height+"px";}function getElem(_72){return document.getElementById(_72);}function addEvent(obj,_74,fn){if(obj.addEventListener){obj.addEventListener(_74,fn,false);return true;}if(obj.attachEvent){obj.detachEvent("on"+_74,fn);return obj.attachEvent("on"+_74,fn);}return false;}function removeEvent(obj,_77,fn){if(obj.removeEventListener){obj.removeEventListener(_77,fn,false);return true;}if(obj.detachEvent){return obj.detachEvent("on"+_77,fn);}return false;}}fbox_engine();