Function.prototype.Extends=function(A,D){var E=this.prototype,C=this.prototype=new A();if(D){C._className=D}for(var B in E){C[B]=E[B]}this.prototype.constructor=E.constructor;E=null;if(C.hashCode){delete Sys._instances[C.hashCode]}return C};if(typeof(Sys)!="function"){var counter=0;window.Sys=function(A){Sys._instances[(this.hashCode=(A||UID()))]=this};function UID(){return"mz_"+(counter++).toString(36)}Sys._instances={};Sys.getUniqueId=UID;Sys.extend=function(C,B){for(var A in B){C[A]=B[A]}return C};Sys.ie=navigator.userAgent.indexOf("MSIE")>0&&!window.opera}Sys.ie=!!window.ActiveXObject;Sys.prototype.toString=function(){return"[object "+(this._className||"Object")+"]"};Sys.loadCssFile=function(B,D){if(/\w+\.\w+(\?|$)/.test(B)){if(!(typeof(D)=="string"&&D!="")){D="MzCss_"+B.replace(/\W/g,"")}var C=document.createElement("LINK");C.href=B;C.id=D;C.type="text/css";C.rel="Stylesheet";var A=document.getElementsByTagName("HEAD")[0];A.insertBefore(C,A.firstChild)}};(function(){var A=document.getElementsByTagName("SCRIPT");if(A.length){if(!Sys.scriptElement){Sys.scriptElement=A[A.length-1]}if(Sys.scriptElement.id.toLowerCase().indexOf("_firebug")==0){Sys.scriptElement=A[A.length-2]}A=Sys.scriptElement.src.replace(/\\/g,"/");A=(A.lastIndexOf("/")<0?".":A.substring(0,A.lastIndexOf("/")))}Sys.path=A})();Sys.resourcePath=Sys.path+"/Fe/_resource";Sys.blankImage=Sys.path+"/Fe/_resource/blank.gif";if(!(typeof(Fe)=="object"&&Fe&&Fe.version)){var Fe={version:"20080809",emptyFn:function(){}}}Fe.G=function(){for(var A=[],B=arguments.length-1;B>-1;B--){var C=arguments[B];A[B]=null;if(typeof(C)=="object"&&C&&C.dom){A[B]=C.dom}else{if((typeof(C)=="object"&&C&&C.tagName)||C==window||C==document){A[B]=C}else{if(typeof(C)=="string"&&(C=document.getElementById(C))){A[B]=C}}}}return A.length<2?A[0]:A};Fe.on=function(C,B,A){if(!(C=Fe.G(C))){return false}B=B.replace(/^on/,"").toLowerCase();if(C.attachEvent){C[B+A]=function(){A.call(C,window.event)};C.attachEvent("on"+B,C[B+A])}else{C.addEventListener(B,A,false)}};Fe.extend=function(D,A,C){if(C){Fe.extend(D,C)}if(D&&A&&typeof(A)=="object"){for(var B in A){D[B]=A[B]}}return D};Fe.each=function(E,A){if(E){if(E.length==undefined){for(var B in E){A.call(E[B],E[B],B)}}else{for(var C=0,D=E.length;C<D;C++){A.call(E[C],E[C],C)}}}return E};Fe.Q=function(E,D,B){if(typeof E!="string"||E.length<=0){return null}var I=[],B=(typeof B=="string"&&B.length>0)?B.toLowerCase():null,C=(Fe.G(D)||document);if(C.getElementsByClassName){Fe.each(C.getElementsByClassName(E),function(J){if(B!=null){if(J.tagName.toLowerCase()==B){I[I.length]=J}}else{I[I.length]=J}})}else{E=E.replace(/\-/g,"\\-");var A=new RegExp("(^|\\s{1,})"+Fe.trim(E)+"(\\s{1,}|$)"),G=(B==null)?(C.all?C.all:C.getElementsByTagName("*")):C.getElementsByTagName(B),F=G.length,H=F;while(F--){if(A.test(G[H-F-1].className)){I[I.length]=G[H-F-1]}}}return I};Fe.trim=function(A){return A.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+$)/g,"")};Fe.ImagePlay=FEImagePlay;Fe.log=function(A){alert(A)};Fe.ImagePlay.install=function(A,C,B){new FEImagePlay(A,C,B)};function FEImagePlay(A,D,B){var C=this;Sys.call(C);Fe.extend(C,D||{});Fe.extend(C,B||{});C.container=Fe.G(A)||false;C.pic_total=C.pic_detail.length,C.html='<a href="'+C.pic_detail[0].pic_url+'" id="lookPic_'+C.hashCode+'" class="lookPic" target="_blank">\u67e5\u770b\u539f\u56fe</a>';C.html+='<a href="javascript:void(0);" id="playPic_'+C.hashCode+'" class="playPic" >\u81ea\u52a8\u64ad\u653e</a>';C.html+='<div id="img_mover_body" class="img_mover_body" ><div id="img_show_bl_'+C.hashCode+'" class="img_show_bl">&nbsp;</div><div id="img_show_br_'+C.hashCode+'" class="img_show_br">&nbsp;</div><div class="img_show_wrapper"><table class="img_show"><tr><td><img id="img_main_'+C.hashCode+'" class="img_main" src="'+C.pic_detail[0].pic_url+'" alt="\u70b9\u51fb\u6d4f\u89c8\u4e0b\u4e00\u5f20" /></td></tr></table></div><div id="img_info_'+C.hashCode+'" class="img_info"><div id="picCount_'+C.hashCode+'" class="picCount"><span id="img_count_'+C.hashCode+'" style="zoom:1;">1</span>/'+C.pic_total+'</div><h1 id="slideTitle_'+C.hashCode+'" class="slideTitle">'+C.pic_detail[0].pic_intro+'</h1></div><div class="slide_bottom"><div class="img_mover_arrow_next" id="img_mover_arrow_next_'+C.hashCode+'" ></div><div class="img_mover_wrapper_show"><div class="img_mover" style="left:0px;top:0px;"></div></div><div class="img_mover_arrow_prev" id="img_mover_arrow_prev_'+C.hashCode+'" ></div></div><div style="display:none;"><div class="img_mover_arrow_next" id="img_mover_arrow_next_'+C.hashCode+'" ></div><div class="img_mover_arrow_prev" id="img_mover_arrow_prev_'+C.hashCode+'" ></div></div></div>';C.img_mover=null;C.img_mover_arrow_prev=null;C.img_mover_arrow_next=null;C.img_show_bl=null;C.img_show_br=null;C.move_timer=null;C.move_state="onblockmovefinish";C.cmd_state="onstop";C.head_num=0;C.end_num=C.pic_show_num-1;C.scroll_num=0;C.currNum=1;C.rollInfo={obj:null,offset:null,direction:null};C.todo="";C.enable=true;C.imgWH=new Array(C.pic_total);C.setCurImgFlag=false;C.num=5;C.circle=true;C.reachLeft=false;C.reachRight=false;C.install()}FEImagePlay.Extends(Sys,"FEImagePlay");(function(){FEImagePlay.prototype.install=function(){Sys.loadCssFile(this.css_path,"CSS_FEImagePlay");var E=this;E.container.innerHTML=E.html;E.lookPicObj=Fe.G("lookPic_"+E.hashCode);E.playPicObj=Fe.G("playPic_"+E.hashCode);E.img_mover=Fe.Q("img_mover",E.container,"div")[0];if(E.pic_detail.length<=E.pic_show_num){E.enable=false}E.addimgs();E.img_mover_arrow_prev=Fe.G("img_mover_arrow_prev_"+E.hashCode);E.img_mover_arrow_next=Fe.G("img_mover_arrow_next_"+E.hashCode);E.img_show_bl=Fe.G("img_show_bl_"+E.hashCode);E.img_show_br=Fe.G("img_show_br_"+E.hashCode);if(E.enable){Fe.on(E.img_mover_arrow_prev,"mousedown",function(){if(E.cmd_state!="onstopNow"&&E.cmd_state!="onstop"){E.stopNow("onprev")}else{E.setCMDState("onprev");E.goPrev()}});Fe.on(E.img_mover_arrow_prev,"mouseup",function(){E.setCMDState("onstop")});Fe.on(E.img_mover_arrow_next,"mousedown",function(){if(E.cmd_state!="onstopNow"&&E.cmd_state!="onstop"){E.stopNow("onnext")}else{E.setCMDState("onnext");E.goNext()}});Fe.on(E.img_mover_arrow_next,"mouseup",function(){E.setCMDState("onstop")});Fe.on(E.playPicObj,"click",function(){E.setCMDState("onauto");E.goAuto(1,10)});Fe.on(E.img_mover,"mouseover",function(){E.setCMDState("onstop")})}Fe.on(E.img_show_bl,"mousedown",function(){E.setCurImgFlag=true;if(E.enable){if(E.cmd_state!="onstopNow"&&E.cmd_state!="onstop"){E.stopNow("onprev")}else{E.setCMDState("onprev");E.goNext(1)}E.setCMDState("onstop")}else{var G=E.currNum;G--;if(G>E.pic_total){G=1}else if(G<=0){G=E.pic_total}Fe.G("img_main_"+E.hashCode).src=E.pic_detail[G-1].pic_url;Fe.G("slideTitle_"+E.hashCode).innerHTML=E.pic_detail[G-1].pic_intro;Fe.G("lookPic_"+E.hashCode).href=E.pic_detail[G-1].pic_url;Fe.G("img_count_"+E.hashCode).innerHTML=G;E.clearSelectedBorder();Fe.G("img_"+(G-1)+"_"+E.hashCode).className+="on border";E.imgShape("img_main_"+E.hashCode,E.imgWH[G-1].w,E.imgWH[G-1].h,E.main_w,E.main_h);E.currNum=G}});Fe.on(E.img_show_bl,"mouseup",function(){E.setCMDState("onstop")});Fe.on(E.img_show_br,"mousedown",function(){E.setCurImgFlag=true;if(E.enable){if(E.cmd_state!="onstopNow"&&E.cmd_state!="onstop"){E.stopNow("onprev")}else{E.setCMDState("onprev");E.goPrev(1)}E.setCMDState("onstop")}else{var G=E.currNum;G++;if(G>E.pic_total){G=1}Fe.G("img_main_"+E.hashCode).src=E.pic_detail[G-1].pic_url;Fe.G("slideTitle_"+E.hashCode).innerHTML=E.pic_detail[G-1].pic_intro;Fe.G("lookPic_"+E.hashCode).href=E.pic_detail[G-1].pic_url;Fe.G("img_count_"+E.hashCode).innerHTML=G;E.clearSelectedBorder();Fe.G("img_"+(G-1)+"_"+E.hashCode).className+="on border";E.imgShape("img_main_"+E.hashCode,E.imgWH[G-1].w,E.imgWH[G-1].h,E.main_w,E.main_h);E.currNum=G}});Fe.on(E.img_show_br,"mouseup",function(){E.setCMDState("onstop")});Fe.on(Fe.G("img_main_"+E.hashCode),"click",function(){E.setCurImgFlag=true;if(E.enable){if(E.cmd_state!="onstopNow"&&E.cmd_state!="onstop"){E.stopNow("onprev")}else{E.setCMDState("onprev");E.goPrev(1)}E.setCMDState("onstop")}else{var G=E.currNum;G++;if(G>E.pic_total){G=1}Fe.G("img_main_"+E.hashCode).src=E.pic_detail[G-1].pic_url;Fe.G("slideTitle_"+E.hashCode).innerHTML=E.pic_detail[G-1].pic_intro;Fe.G("lookPic_"+E.hashCode).href=E.pic_detail[G-1].pic_url;Fe.G("img_count_"+E.hashCode).innerHTML=G;E.clearSelectedBorder();Fe.G("img_"+(G-1)+"_"+E.hashCode).className+="on border";E.imgShape("img_main_"+E.hashCode,E.imgWH[G-1].w,E.imgWH[G-1].h,E.main_w,E.main_h);E.currNum=G}});Fe.on(Fe.G("img_main_"+E.hashCode),"mouseup",function(){E.setCMDState("onstop")});var C=0;for(var D=0,A=2*E.pic_detail.length-1,B=E.pic_detail.length;D<A;D++){function F(H){var G=Fe.G("img_"+H+"_"+E.hashCode);Fe.on(G,"onload",function(){E.fixImg(G)});Fe.on(G,"click",function(){E.clearSelectedBorder();G.className+=" on border";Fe.G("img_main_"+E.hashCode).src=E.pic_detail[H%B].pic_url;Fe.G("slideTitle_"+E.hashCode).innerHTML=E.pic_detail[H%B].pic_intro;Fe.G("lookPic_"+E.hashCode).href=E.pic_detail[H%B].pic_url;Fe.G("img_info_"+E.hashCode).style.filter='';Fe.G("img_count_"+E.hashCode).innerHTML=(parseInt(G.name))%E.pic_total+1;Fe.G("img_info_"+E.hashCode).style.filter='alpha(opacity=50)';E.currNum=parseInt(G.name)+1;E.imgShape("img_main_"+E.hashCode,E.imgWH[H%B].w,E.imgWH[H%B].h,E.main_w,E.main_h)});Fe.on(G,"mouseover",function(){E.clearSelectedOn();G.className+=" on"})}new F(C);C++}};FEImagePlay.prototype.render=function(){};FEImagePlay.prototype.trigger=function(A){};FEImagePlay.prototype.goAuto=function(B,A){var C=this;if(C.move_state=="onblockmove"){return}var D=C.num;if(!isNaN(B)){D=B}C.roll(C.img_mover,C.move_len,-C.step/A,C.time_inerval,D)};FEImagePlay.prototype.goPrev=function(A){var B=this;if(B.move_state=="onblockmove"){return}var C=B.num;if(!isNaN(A)){C=A}B.roll(B.img_mover,B.move_len,-B.step,B.time_inerval,C)};FEImagePlay.prototype.goNext=function(A){var B=this;if(B.move_state=="onblockmove"){return}var C=B.num;if(!isNaN(A)){C=A}B.roll(B.img_mover,B.move_len,B.step,B.time_inerval,C)};FEImagePlay.prototype.roll=function(L,O,C,K,E){var Q=this;if(!L||!O||!C||C==0||!K||!E){Fe.log("Param Error!");return false}var R=Q.roll_direction;var F=0,J=0;var G=Math.abs(C);var M=Math.abs(C)/C;var D=0;Q.setMoveState("onblockmove");var B=false;var A=false;var P=Q.getMoveOffset()*M/Q.move_len+Q.pic_show_num;var N=Q.getMoveOffset();var H=window.setInterval(function(){if(C>0&&Q.getMoveOffset()==0){if(Q.circle){Q.setMoveOffset(-Q.pic_detail.length*O)}}F+=G;if(F<=O){P=Q.getMoveOffset()*M/Q.move_len+Q.pic_show_num;if(!Q.circle&&P==Q.pic_detail.length&&C<0){A=true}else{A=false}N=Q.getMoveOffset();if(!Q.circle&&N==0&&C>0){B=true}else{B=false}I(L,C,R);Q.setMoveState("onblockmove");if(Q.cmd_state=="onstopNow"){I(L,M*(O-F),R);Q.setMoveState("onblockmovefinish");window.clearInterval(H);if(Q.todo!=""){if(Q.todo=="onprev"){Q.setCMDState("onprev");Q.goPrev()}else{if(Q.todo=="onnext"){Q.setCMDState("onnext");Q.goNext()}}}}}else{D=I(L,M*(O%C),R);J++;F=0;if(J%E==0){if(Q.getMoveOffset()<=-Q.pic_detail.length*O){if(Q.circle){Q.setMoveOffset(Q.getMoveOffset()+Q.pic_detail.length*O)}}Q.setMoveState("onblockmovefinish");if((Q.setCurImgFlag||Q.cmd_state=="onauto")&&Q.circle){Q.setCurrImg(M,E)}else{if((Q.setCurImgFlag||Q.cmd_state=="onauto")&&!Q.circle){if(Q.currNum<Q.pic_detail.length&&!B){Q.setCurrImg(M,E)}}}Q.setCurImgFlag=false}if(J%E==0&&Q.move_state=="onblockmovefinish"&&Q.cmd_state=="onstop"){Q.cmd_state=="onstopNow";window.clearInterval(H)}}},K);Q.move_timer=H;function I(U,T,S){if(B||A){T=0}if(S=="h"){U.style.left=parseInt(U.style.left)+T+"px";return U.style.left}else{U.style.top=parseInt(U.style.top)+T+"px";return U.style.top}}};FEImagePlay.prototype.setMoveState=function(A){this.move_state=A};FEImagePlay.prototype.setCMDState=function(A){this.cmd_state=A;FEImagePlay.log(A)};FEImagePlay.prototype.getMoveOffset=function(){if(this.roll_direction=="v"){return parseInt(this.img_mover.style.top)}else{if(this.roll_direction=="h"){return parseInt(this.img_mover.style.left)}else{return null}}};FEImagePlay.prototype.setMoveOffset=function(A){if(this.roll_direction=="v"){this.img_mover.style.top=A+"px"}else{if(this.roll_direction=="h"){this.img_mover.style.left=A+"px"}}};FEImagePlay.prototype.setImgCount=function(A){Fe.G("img_count_"+me.hashCode).innerHTML=parseInt(imgObj.num)+1};FEImagePlay.prototype.setCurrImg=function(B,A){var D=this;var C=D.currNum;if(B<0){C+=A}else{C-=A}C=C%D.pic_total;if(C>D.pic_detail.length){C=1}else{if(C<1){C=D.pic_detail.length}}D.currNum=C;Fe.G("img_main_"+D.hashCode).src=D.pic_detail[D.currNum-1].pic_url;Fe.G("slideTitle_"+D.hashCode).innerHTML=D.pic_detail[D.currNum-1].pic_intro;Fe.G("lookPic_"+D.hashCode).href=D.pic_detail[D.currNum-1].pic_url;Fe.G("img_info_"+D.hashCode).style.filter='';Fe.G("img_count_"+D.hashCode).innerHTML=D.currNum;Fe.G("img_info_"+D.hashCode).style.filter='alpha(opacity=50)';D.clearSelectedBorder();Fe.G("img_"+(D.currNum-1)+"_"+D.hashCode).className+="on border";Fe.G("img_"+((D.currNum-1)%D.pic_total+D.pic_total)+"_"+D.hashCode).className+="on border";D.imgShape("img_main_"+D.hashCode,D.imgWH[D.currNum-1].w,D.imgWH[D.currNum-1].h,D.main_w,D.main_h)};FEImagePlay.prototype.stopNow=function(A){var B=this;B.todo=A;B.setCMDState("onstopNow")};FEImagePlay.prototype.addimgs=function(){var C=this;var A=0;if(!C.enable){A=C.pic_detail.length}else{A=2*C.pic_detail.length}for(var B=0;B<A;B++){if(C.roll_direction=="h"){C.img_mover.innerHTML+='<a id="img_block_'+B+"_"+C.hashCode+'" href="javascript:void(0);" style="left:'+B*C.move_len+'px;"><table border="0" cellpadding="0" cellspacing="0" style="height:90px;width:95px;"><tr><td><img class="img" id="img_'+B+"_"+C.hashCode+'" name="'+B+'" src="'+C.pic_detail[B%C.pic_detail.length].pic_url+'" /></td></tr></table></a>'}else{if(C.roll_direction=="v"){C.img_mover.innerHTML+='<a id="img_block_'+B+"_"+C.hashCode+'" href="javascript:void(0);" style="top:'+B*C.move_len+'px;"><img class="img" id="img_'+B+"_"+C.hashCode+'" name="'+B+'" src="'+C.pic_detail[B%C.pic_detail.length].pic_url+'" /></a>'}else{alert("\u8bf7\u8bbe\u5b9a\u6c34\u5e73\u6216\u5782\u76f4\u6eda\u52a8")}}}};FEImagePlay.prototype.fixImg=function(E){var C=this;var A=parseInt(E.width);var B=parseInt(E.height);var F=C.pic_w;var D=C.pic_h;if(parseInt(E.name)<C.pic_total){C.imgWH[E.name]={w:A,h:B}}C.imgShape(E.id,A,B,F,D);if(Fe.G("img_main_"+C.hashCode).src==E.src&&parseInt(E.name)<C.pic_total){C.imgShape("img_main_"+C.hashCode,C.imgWH[E.name].w,C.imgWH[E.name].h,C.main_w,C.main_h)}};FEImagePlay.prototype.imgShape=function(E,A,B,D,C){if(A>=D&&B>=C){if(D*B/A>C){Fe.G(E).style.height=C+"px";Fe.G(E).style.width=C*A/B+"px"}else{Fe.G(E).style.width=D+"px";Fe.G(E).style.height=D*B/A+"px"}}else{if(A<D&&B>C){Fe.G(E).style.height=C+"px";Fe.G(E).style.width=C*A/B+"px"}else{if(A>D&&B<C){Fe.G(E).style.width=D+"px";Fe.G(E).style.height=D*B/A+"px"}else{Fe.G(E).style.width=A+"px";Fe.G(E).style.height=B+"px"}}}};FEImagePlay.prototype.clearSelected=function(){var D=this;var C="";for(var B=0,A=2*D.pic_total;B<A;B++){if(Fe.G("img_"+B+"_"+D.hashCode)){C=Fe.G("img_"+B+"_"+D.hashCode).className;Fe.G("img_"+B+"_"+D.hashCode).className=C.replace("on","")}}};FEImagePlay.prototype.clearSelectedOn=function(){var D=this;var C="";for(var B=0,A=2*D.pic_total;B<A;B++){if(Fe.G("img_"+B+"_"+D.hashCode)){C=Fe.G("img_"+B+"_"+D.hashCode).className;Fe.G("img_"+B+"_"+D.hashCode).className=C.replace("on","")}}};FEImagePlay.prototype.clearSelectedBorder=function(){var D=this;var C="";for(var B=0,A=2*D.pic_total;B<A;B++){if(Fe.G("img_"+B+"_"+D.hashCode)){C=Fe.G("img_"+B+"_"+D.hashCode).className;Fe.G("img_"+B+"_"+D.hashCode).className=C.replace("border","");Fe.G("img_"+B+"_"+D.hashCode).className=Fe.G("img_"+B+"_"+D.hashCode).className.replace("on","")}}};FEImagePlay.log=function(A){if(Fe.G("log1")&&A!="onblockmove"){Fe.G("log1").innerHTML=Fe.G("log1").innerHTML+"-->m:"+A}}})();var config_json1={css_path:"http://i.baidu.com/yule/r/yule/v3/tuji/cms_album_v0.2.css",main_w:530,main_h:550,pic_w:95,pic_h:71,pic_show_num:5,move_len:102,step:30,time_inerval:20,roll_direction:"h"};function cms_Ablbum(id,str){var json=eval("("+str+")");pic_json1=json;Fe.ImagePlay.install(id,config_json1,pic_json1)};
