﻿/*
 * Compressed by iPow(www.iPow.cn)
 */
jQuery.fn.scrollPic=function(A){A=jQuery.extend({width:94,height:400,_width:50,_height:50,tool:"picTool",list:"picList",type:"ajax"},A);return this.each(function(){$local=$(this);var C=[],G=0,I=0,F=0,O=function(A){try{C=J(A);$("<div id=\"msgWin\" class=\"showMsg\"></div>").appendTo("body");$("#listInfo").css("height",C.offHeight-50);$(A).hover(function(){M(A)},function(){N(A)});I=$(A).find("a").size();$(A).find("a").each(function(A){this.onclick=function(){F=A;P(this,0);return false}});$(window).scroll(function(){C=J(A);$(A).css("top",C.scrTop)});$(window).resize(function(){C=J(A);$("#listInfo").css("height",C.offHeight-50)})}catch(B){}},M=function(B){try{$("#"+A.tool).hide(1,function(){$("#prevScoll").show();$("#"+A.list).show();H("#listInfo")})}catch(C){}},N=function(B){$("#"+A.list).hide(1,function(){$("#"+A.tool).show()})},P=function(D,G){try{if(G>0)D=$("#listInfo").find("a:eq("+F+")");C=J(D);var B=parseInt(C.scrTop),H=0;if(!$("#msgWin").is(":hidden"))E(D);else{$("#msgWin").css({"left":C.offLeft,"top":C.offTop});if(C.offWidth>A._width)H=parseInt((C.offWidth-A._width)/2);if(C.offHeight>A._height)B=B+parseInt((C.offHeight-A._height)/2);$("#msgWin").animate({opacity:"show",width:A._width,height:A._height,top:B,left:H},300,function(){E(D)})}}catch(I){}},E=function(B){try{switch(A.type){case"url":break;case"ajax":D(B);break;case"frame":var C=B.title;break;default:break}}catch(E){}},D=function(C){var E="<a href=\"javascript:;\" id=\"closeWin\" class=\"picclose\" title=\"\u5173\u95ed\"></a>\t\t\t<div id=\"msgContainer\" style=\"height:"+parseInt(A._height)+"px;\"><img src=\"/images/pic/loading.gif\" align=\"middle\" ></div>";$("#msgWin").html(E);var D=$(C).attr("href");$("#msgContainer").fadeIn("fast",function(){K(D)});$("#closeWin").click(function(){B()})},H=function(E){try{var F=parseInt(A.height*I);C=J(E);var K=C.offHeight-50,D=G,B=F-K;H();function H(){if(G>0)A();if(G<B){$("#listNext").unbind("click");$("#listNext").click(function(){G=parseInt(G+108);$("#listInfo").animate({scrollTop:G},1000,function(){G=G>=B?B:G;if(G==B){$("#listNext").attr("class","next1");$("#listPrev").attr("class","prev");$("#listNext").unbind("click");A()}else if(G<B){$("#listNext").attr("class","next");$("#listPrev").attr("class","prev");A()}})})}var A=function(){$("#listPrev").unbind("click");$("#listPrev").click(function(){G=parseInt(G-108);$("#listInfo").animate({scrollTop:G},1000,function(){G=G<0?0:G;if(G==0){$("#listPrev").attr("class","prev1");$("#listNext").attr("class","next");$("#listPrev").unbind("click");C()}else if(G>0){$("#listPrev").attr("class","prev");$("#listNext").attr("class","next");C()}})})},C=function(){$("#listNext").unbind("click");$("#listNext").click(function(){G=parseInt(G+108);$("#listInfo").animate({scrollTop:G},1000,function(){G=G>=B?B:G;if(G==B){A();$("#listPrev").attr("class","prev");$("#listNext").attr("class","next1");$("#listNext").unbind("click")}else if(G<B){$("#listNext").attr("class","next");$("#listPrev").attr("class","prev");A()}})})}}}catch(L){}},K=function(D){var A=new Image();A.src=D;var B;if(A.complete)E();else B=setInterval(function(){if(A.complete){E();clearInterval(B)}},1000);function E(){try{var B={width:A.width,height:A.width},F=A.width/A.height,E=document.body.clientWidth*0.95;E=A.width>E?E:A.width;var G=E/F,I=C.offHeight,K=C.scrTop;if(G>I){G=I*0.95;E=G*F}var J=parseInt((C.offWidth-E)/2),H=parseInt((C.offHeight-G)/2)+parseInt(C.scrTop);$("#msgWin").animate({width:E,height:G,left:J,top:H},300,function(){$("#msgContainer").html("<img src = \""+D+"\" width=\""+parseInt(E)+"\" height=\""+parseInt(G)+"\">");$("#msgContainer").append("<a href=\"javascript:;\" class=\"picPrev\" id=\"PicPrev\"></a><a href=\"javascript:;\" id=\"PicNext\" class=\"picNext\"></a>");$("#msgContainer").mousemove(function(){L(J,E)})})}catch(M){}}},L=function(D,C){var B=event.clientX,A=D;if(B>D&&B<D+C/2-40&&F>0)$("#PicPrev").show(1,function(){$(this).one("click",function(){F=F-1;P(this,1)})});else $("#PicPrev").hide();if(B>D+C/2+40&&B<D+C&&F<I-1)$("#PicNext").show(1,function(){$(this).one("click",function(){F=F+1;P(this,1)})});else $("#PicNext").hide()},J=function(B){var D=[],C=$(B).offset();D.offLeft=C.left;D.offTop=C.top;D.offWidth=document.documentElement.clientWidth;D.offHeight=document.documentElement.clientHeight;var A;if(typeof window.pageYOffset!="undefined")A=window.pageYOffset;else if(typeof document.compatMode!="undefined"&&document.compatMode!="BackCompat")A=document.documentElement.scrollTop;else if(typeof document.body!="undefined")A=document.body.scrollTop;D.scrTop=A;return D},B=function(){var B=0;if(C.offWidth>A._width)B=parseInt((C.offWidth-A._width)/2);var D=parseInt(C.offTop);$("#msgWin").animate({opacity:"hide",width:0,height:0,left:C.offLeft,top:D},300);$("#msgWin").html("")};O(this)})}