eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([3-59cf-hj-mo-rt-yCG-NP-RT-Z]|[12]\\w)'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('4 $$,$$B,$$A,$$F,$$D,$$E,$$CE,$$S;(3(){4 O,B,A,F,D,E,CE,S;O=3(id){5"22"==1F id?P.getElementById(id):id};O.emptyFunction=3(){};O.extend=3(N,13,1r){9(1r===23)1r=14;I(4 Q x 13){9(1r||!(Q x N)){N[Q]=13[Q]}}5 N};O.deepextend=3(N,13){I(4 Q x 13){4 1h=13[Q];9(N===1h)continue;9(1F 1h==="c"){N[Q]=L.callee(N[Q]||{},1h)}J{N[Q]=1h}}5 N};O.wrapper=3(me,25){4 1G=3(){me.R(Z,L)};4 1H=3(){};1H.15=25.15;1G.15=new 1H;5 1G};B=(3(T){4 b={17:/17/.M(T)&&!/1I/.M(T),1I:/1I/.M(T),26:/webkit/.M(T)&&!/1J/.M(T),27:/27/.M(T),1J:/1J/.M(T)};4 1s="";I(4 i x b){9(b[i]){1s="26"==i?"1i":i;1K}}b.1i=1s&&1L("(?:"+1s+")[\\\\/: ]([\\\\d.]+)").M(T)?1L.$1:"0";b.ie=b.17;b.28=b.17&&1N(b.1i,10)==6;b.ie7=b.17&&1N(b.1i,10)==7;b.29=b.17&&1N(b.1i,10)==8;5 b})(1O.navigator.userAgent.toLowerCase());A=3(){4 m={isArray:3(2a){5 Object.15.toString.18(2a)==="[c 1P]"},1t:3(K,W,j){9(K.1t){5 1u(j)?K.1t(W):K.1t(W,j)}J{4 U=K.1j;j=1u(j)?0:j<0?1v.2b(j)+U:1v.2c(j);I(;j<U;j++){9(K[j]===W)5 j}5-1}},1w:3(K,W,j){9(K.1w){5 1u(j)?K.1w(W):K.1w(W,j)}J{4 U=K.1j;j=1u(j)||j>=U-1?U-1:j<0?1v.2b(j)+U:1v.2c(j);I(;j>-1;j--){9(K[j]===W)5 j}5-1}}};3 11(c,t){9(23===c.1j){I(4 l x c){9(y===t(c[l],l,c))1K}}J{I(4 i=0,U=c.1j;i<U;i++){9(i x c){9(y===t(c[i],i,c))1K}}}};11({2d:3(c,t,r){11(c,3(){t.R(r,L)})},map:3(c,t,r){4 m=[];11(c,3(){m.2e(t.R(r,L))});5 m},1x:3(c,t,r){4 m=[];11(c,3(2f){t.R(r,L)&&m.2e(2f)});5 m},every:3(c,t,r){4 m=14;11(c,3(){9(!t.R(r,L)){m=y;5 y}});5 m},some:3(c,t,r){4 m=y;11(c,3(){9(t.R(r,L)){m=14;5 y}});5 m}},3(2g,l){m[l]=3(c,t,r){9(c[l]){5 c[l](t,r)}J{5 2g(c,t,r)}}});5 m}();F=(3(){4 19=1P.15.19;5{bind:3(1y,r){4 1a=19.18(L,2);5 3(){5 1y.R(r,1a.2h(19.18(L)))}},bindAsEventListener:3(1y,r){4 1a=19.18(L,2);5 3(h){5 1y.R(r,[E.1k(h)].2h(1a))}}}})();D={1z:3(p){4 1b=p?p.2i:P;5 1b.2j.2k||1b.2l.2k},1A:3(p){4 1b=p?p.2i:P;5 1b.2j.2m||1b.2l.2m},2n:P.1l?3(a,b){5!!(a.2o(b)&16)}:3(a,b){5 a!=b&&a.2n(b)},G:3(p){4 q=0,V=0,X=0,Y=0;9(!p.2p||B.29){4 n=p;while(n){q+=n.offsetLeft,V+=n.offsetTop;n=n.offsetParent};X=q+p.offsetWidth;Y=V+p.offsetHeight}J{4 G=p.2p();q=X=D.1A(p);V=Y=D.1z(p);q+=G.q;X+=G.X;V+=G.V;Y+=G.Y};5{"q":q,"V":V,"X":X,"Y":Y}},clientRect:3(p){4 G=D.G(p),1Q=D.1A(p),1R=D.1z(p);G.q-=1Q;G.X-=1Q;G.V-=1R;G.Y-=1R;5 G},1c:P.1l?3(u){5 P.1l.2q(u,1m)}:3(u){5 u.1S},getStyle:P.1l?3(u,l){4 o=P.1l.2q(u,1m);5 l x o?o[l]:o.getPropertyValue(l)}:3(u,l){4 o=u.o,1c=u.1S;9(l=="12"){9(/1T\\(12=(.*)\\)/i.M(1c.1x)){4 12=parseFloat(1L.$1);5 12?12/2r:0}5 1}J 9(l=="2s"){l="2t"}4 m=1c[l]||1c[S.1U(l)];9(!/^-?\\d+(?:px)?$/i.M(m)&&/^\\-?\\d/.M(m)){4 q=o.q,1B=u.runtimeStyle,2v=1B.q;1B.q=1c.q;o.q=m||0;m=o.pixelLeft+"px";o.q=q;1B.q=2v}5 m},setStyle:3(1n,o,1d){9(!1n.1j){1n=[1n]}9(1F o=="22"){4 s=o;o={};o[s]=1d}A.2d(1n,3(u){I(4 l x o){4 1d=o[l];9(l=="12"&&B.ie){u.o.1x=(u.1S.1x||"").2w(/1T\\([^)]*\\)/,"")+"1T(12="+1d*2r+")"}J 9(l=="2s"){u.o[B.ie?"2t":"cssFloat"]=1d}J{u.o[S.1U(l)]=1d}}})}};E=(3(){4 1e,1f,v=1,1V=3(g,f,k){9(!k.$$v)k.$$v=v++;9(!g.C)g.C={};4 H=g.C[f];9(!H){H=g.C[f]={};9(g["on"+f]){H[0]=g["on"+f]}}};9(1O.1X){4 1o={"mouseenter":"2x","mouseleave":"2y"};1e=3(g,f,k){9(f x 1o){1V(g,f,k);4 2z=g.C[f][k.$$v]=3(h){4 1C=h.1p;9(!1C||(g!=1C&&!(g.2o(1C)&16))){k.18(Z,h)}};g.1X(1o[f],2z,y)}J{g.1X(f,k,y)}};1f=3(g,f,k){9(f x 1o){9(g.C&&g.C[f]){g.2A(1o[f],g.C[f][k.$$v],y);1Y g.C[f][k.$$v]}}J{g.2A(f,k,y)}}}J{1e=3(g,f,k){1V(g,f,k);g.C[f][k.$$v]=k;g["on"+f]=1D};1f=3(g,f,k){9(g.C&&g.C[f]){1Y g.C[f][k.$$v]}};3 1D(){4 1E=14,h=1k();4 H=Z.C[h.f];I(4 i x H){Z.$$1D=H[i];9(Z.$$1D(h)===y){1E=y}}5 1E}}3 1k(h){9(h)5 h;h=1O.h;h.pageX=h.clientX+D.1A(h.1Z);h.pageY=h.clientY+D.1z(h.1Z);h.target=h.1Z;h.20=20;h.21=21;4 1p={"2y":h.toElement,"2x":h.fromElement}[h.f];9(1p){h.1p=1p}5 h};3 20(){Z.cancelBubble=14};3 21(){Z.1E=y};5{"1e":1e,"1f":1f,"1k":1k}})();CE=(3(){4 v=1;5{1e:3(c,f,k){9(!k.$$$v)k.$$$v=v++;9(!c.w)c.w={};9(!c.w[f])c.w[f]={};c.w[f][k.$$$v]=k},1f:3(c,f,k){9(c.w&&c.w[f]){1Y c.w[f][k.$$$v]}},fireEvent:3(c,f){9(!c.w)5;4 1a=1P.15.19.18(L,2),H=c.w[f];I(4 i x H){H[i].R(c,1a)}},clearEvent:3(c){9(!c.w)5;I(4 f x c.w){4 H=c.w[f];I(4 i x H){H[i]=1m}c.w[f]=1m}c.w=1m}}})();S={1U:3(s){5 s.2w(/-([a-z])/ig,3(all,2B){5 2B.toUpperCase()})}};9(B.28){try{P.execCommand("BackgroundImageCache",y,14)}catch(e){}};$$=O;$$B=B;$$A=A;$$F=F;$$D=D;$$E=E;$$CE=CE;$$S=S})();',[],162,'|||function|var|return||||if|||object|||type|element|event||from|handler|name|ret||style|node|left|thisp||callback|elem|guid|cusevents|in|false||||events||||rect|handlers|for|else|array|arguments|test|destination||document|property|apply||ua|len|top|elt|right|bottom|this||each|opacity|source|true|prototype||msie|call|slice|args|doc|curStyle|value|addEvent|removeEvent||copy|version|length|fixEvent|defaultView|null|elems|fix|relatedTarget||override|vMark|indexOf|isNaN|Math|lastIndexOf|filter|fun|getScrollTop|getScrollLeft|rtStyle|related|handleEvent|returnValue|typeof|ins|subclass|opera|chrome|break|RegExp||parseInt|window|Array|sLeft|sTop|currentStyle|alpha|camelize|storage||addEventListener|delete|srcElement|stopPropagation|preventDefault|string|undefined||parent|safari|firefox|ie6|ie8|obj|ceil|floor|forEach|push|item|method|concat|ownerDocument|documentElement|scrollTop|body|scrollLeft|contains|compareDocumentPosition|getBoundingClientRect|getComputedStyle|100|float|styleFloat||rsLeft|replace|mouseover|mouseout|fixhandler|removeEventListener|letter'.split('|'),0,{}))

/*!
 * ImageTrans
 * Copyright (c) 2010 cloudgamer
 * Blog: http://cloudgamer.cnblogs.com/
 * Date: 2010-8-15
 */

//容器对象
var ImageTrans = function(container, options){
	this._initialize( container, options );
	this._initMode();
	if ( this._support ) {
		this._initContainer();
		this._init();
	} else {//模式不支持
		this.onError("not support");
	}
};
ImageTrans.prototype = {
  //初始化程序
  _initialize: function(container, options) {
	var container = this._container = $$(container);
	this._clientWidth = container.clientWidth;//变换区域宽度
	this._clientHeight = container.clientHeight;//变换区域高度
	this._img = new Image();//图片对象
	this._style = {};//备份样式
	this._x = this._y = 1;//水平/垂直变换参数
	this._radian = 0;//旋转变换参数
	this._support = false;//是否支持变换
	this._init = this._load = this._show = this._dispose = (function(){});
	this.X=this.Y=0;
	this.eX=this.eY=0;
	this.sX=this.sY=0;
	var opt = this._setOptions(options);
	
	this._zoom = opt.zoom;
	
	this.onPreLoad = opt.onPreLoad;
	this.onLoad = opt.onLoad;
	this.onError = opt.onError;
	
	this._LOAD = $$F.bind( function(){
		this.onLoad(); this._load(); this.reset();
		this._img.style.visibility = "visible";
	}, this );
	
	$$CE.fireEvent( this, "init" );
  },
  //设置默认属性
  _setOptions: function(options) {
    this.options = {//默认值
		mode:		"css3|filter|canvas",
		zoom:		.1,//缩放比率
		onPreLoad:	function(){},//图片加载前执行
		onLoad:		function(){},//图片加载后执行
		onError:	function(err){}//出错时执行
    };
    return $$.extend(this.options, options || {});
  },
  //模式设置
  _initMode: function() {
	var modes = ImageTrans.modes;
	this._support = $$A.some( this.options.mode.toLowerCase().split("|"), function(mode){
		mode = modes[ mode ];
		if ( mode && mode.support ) {
			mode.init && (this._init = mode.init);//初始化执行程序
			mode.load && (this._load = mode.load);//加载图片执行程序
			mode.show && (this._show = mode.show);//变换显示程序
			mode.dispose && (this._dispose = mode.dispose);//销毁程序
			//扩展变换方法
			$$A.forEach( ImageTrans.transforms, function(transform, name){
				this[ name ] = function(){
					transform.apply( this, [].slice.call(arguments) );
					this._show();
					//alert(transform)
				}
			}, this );
			return true;
		}
	}, this );
  },
  //初始化容器对象
  _initContainer: function() {
	var container = this._container, style = container.style, position = $$D.getStyle( container, "position" );
	this._style = { "position": style.position, "overflow": style.overflow };//备份样式
	if ( position != "relative" && position != "absolute" ) { style.position = "relative"; }
	style.overflow = "hidden";
	$$CE.fireEvent( this, "initContainer" );
  },
  //加载图片
  load: function(src) {
	if ( this._support ) {
		var img = this._img, oThis = this;
		img.onload || ( img.onload = this._LOAD );
		img.onerror || ( img.onerror = function(){ oThis.onError("err image"); } );
		img.style.visibility = "hidden";
		this.onPreLoad();
		img.src = src;
	}
  },
  //重置
  reset: function() {
	if ( this._support ) {
		this._x = this._y = 1; this._radian = 0;
		this._show();
	}
  },
  //销毁程序
  dispose: function() {
	if ( this._support ) {
		this._dispose();
		$$CE.fireEvent( this, "dispose" );
		$$D.setStyle( this._container, this._style );//恢复样式
		this._container = this._img = this._img.onload = this._img.onerror = this._LOAD = null;
	}
  },
  
  drawImage:function(imgsrc){
    var image = new Image();
    image.src = imgsrc;
    var width = this._clientWidth;
    var height = this._clientHeight;
	var rW=null,rH=null;
	var Res=new Array(1);
    if(image.width > 0 && image.height > 0){
        if(image.width / image.height >= width / height){
            if(image.width > width){
                rW = width;
                rH = (image.height * width) / image.width;
				
            }
			else{
                rW = image.width;
                rH = image.height;
            }
        } 
		else{
            if(image.height > height){
                rW = height;
                rH = (image.width * height) / image.height;
            }
			else{
                rW = image.width;
                rH = image.height;
            }
        }
		Res[0]=rW;Res[1]=rH;
    }
	return Res;
}
  
};
//变换模式
ImageTrans.modes = function(){
	var css3Transform;//ccs3变换样式
	//初始化图片对象函数
	function initImg(img, container) {
		$$D.setStyle( img, {
			position: "absolute",
			border: 0, padding: 0, margin: 0, width: "auto", height: "auto",//重置样式
			visibility: "hidden"//加载前隐藏
		});
		container.appendChild( img );
	}
	//获取变换参数函数
	function getMatrix(radian, x, y) {
		var Cos = Math.cos(radian), Sin = Math.sin(radian);
		return {
			M11: Cos * x, M12:-Sin * y,
			M21: Sin * x, M22: Cos * y
		};
	}
	return {
		css3: {//css3设置
			support: function(){
				var style = document.createElement("div").style;
				return $$A.some(
					[ "transform", "MozTransform", "webkitTransform", "OTransform" ],
					function(css){ if ( css in style ) {
						css3Transform = css; return true;
					}});
			}(),
			init: function() { initImg( this._img, this._container ); },
			load: function(){
				var img = this._img;
				var SetImg=this.drawImage(img.src);
				$$D.setStyle( img, {//居中
					top: ( this._clientHeight - img.height ) / 2 + "px",
					left: ( this._clientWidth - img.width ) / 2 + "px",
					visibility: "visible",
					width: SetImg[0] + "px",
					height: SetImg[1] + "px"
				});
			},
			show: function() {
				var matrix = getMatrix( this._radian, this._y, this._x );
				//设置变形样式
				
				this._img.style[ css3Transform ] = "matrix("
					+ matrix.M11.toFixed(16) + "," + matrix.M21.toFixed(16) + ","
					+ matrix.M12.toFixed(16) + "," + matrix.M22.toFixed(16) + ", 0, 0)";
			},
			dispose: function(){ this._container.removeChild(this._img); }
		},
		filter: {//滤镜设置
			support: function(){ return "filters" in document.createElement("div"); }(),
			init: function() {
				initImg( this._img, this._container );
				//设置滤镜
				this._img.style.filter = "progid:DXImageTransform.Microsoft.Matrix(SizingMethod='auto expand')";
			},
			load: function(){
				this._img.onload = null;//防止ie重复加载gif的bug
				this._img.style.visibility = "visible";
			},
			show: function() {
				var img = this._img;
				//设置滤镜
				$$.extend(
					img.filters.item("DXImageTransform.Microsoft.Matrix"),
					getMatrix( this._radian, this._y, this._x )
				);
				//alert('ok')
				//var SetImg=this.drawImage(img.src);
//				img.style.width=SetImg[0]+'px';
//				img.style.height=SetImg[1]+'px';
				
				//保持居中
					
				//img.style.top = (this._clientHeight >= img.offsetHeight)?( this._clientHeight - img.offsetHeight ) / 2 + "px" : ( this.Y +this.sY-this.eY) +"px" ;
				//img.style.left = ( this._clientWidth >= img.offsetWidth )?( this._clientWidth - img.offsetWidth ) / 2 + "px" : (this.X+this.sX-this.eX) + "px" ;
				if(this._clientHeight >= img.offsetHeight )
					img.style.top=( this._clientHeight - img.offsetHeight ) / 2 + "px";
				else{
					var DragTop=this.Y+this.sY-this.eY;
					if(DragTop>=(this._clientHeight - img.offsetHeight )&&DragTop<=0){
						img.style.top = DragTop + "px" ;
						this.Y=DragTop;
					}
					else if(DragTop<(this._clientHeight - img.offsetHeight )){
						img.style.top = (this._clientHeight - img.offsetHeight ) +"px";
						this.Y=(this._clientHeight - img.offsetHeight );
						}
					else {
						img.style.top = "0px";
						this.Y=0;	
					}
				}
				
				if(this._clientWidth >= img.offsetWidth )
					img.style.left=( this._clientWidth - img.offsetWidth ) / 2 + "px";
				else{
					var Dragleft=this.X+this.sX-this.eX;
					if(Dragleft>=(this._clientWidth - img.offsetWidth )&&Dragleft<=0){
						img.style.left = Dragleft + "px" ;
						this.X=Dragleft;
					}
					else if(Dragleft<(this._clientWidth - img.offsetWidth )){
						img.style.left = (this._clientWidth - img.offsetWidth ) +"px";
						this.X=(this._clientWidth - img.offsetWidth );
						}
					else {
						img.style.left = "0px";
						this.X=0;	
					}
				}
				
			},
			dispose: function(){ this._container.removeChild(this._img); }
		},
		canvas: {//canvas设置
			support: function(){ return "getContext" in document.createElement('canvas'); }(),
			init: function() {
				var canvas = this._canvas = document.createElement('canvas'),
					context = this._context = canvas.getContext('2d');
				//样式设置
				$$D.setStyle( canvas, { position: "absolute", left: 0, top: 0 } );
				canvas.width = this._clientWidth; canvas.height = this._clientHeight;
				this._container.appendChild(canvas);
			},
			show: function(){
				
				var img = this._img, context = this._context,
					clientWidth = this._clientWidth, clientHeight = this._clientHeight;
				//canvas变换
				context.save();
				context.clearRect( 0, 0, clientWidth, clientHeight );//清空内容
				context.translate( clientWidth / 2 , clientHeight / 2 );//中心坐标
				context.rotate( this._radian );//旋转
				context.scale( this._y, this._x );//缩放
				context.drawImage( img, -img.width / 2, -img.height / 2 );//居中画图
				context.restore();
			},
			dispose: function(){
				this._container.removeChild( this._canvas );
				this._canvas = this._context = null;
			}
		}
	};
}();
//变换方法
ImageTrans.transforms = {
  //垂直翻转
  vertical: function() {
	this._radian = Math.PI - this._radian; this._y *= -1;
  },
  //水平翻转
  horizontal: function() {
	this._radian = Math.PI - this._radian; this._x *= -1;
  },
  //根据弧度旋转
  rotate: function(radian) { this._radian = radian; },
  //向左转90度
  left: function() { this._radian -= Math.PI/2; },
  //向右转90度
  right: function() { this._radian += Math.PI/2; },
  //根据角度旋转
  rotatebydegress: function(degress) { this._radian = degress * Math.PI/180; },
  //缩放
  scale: function () {
	function getZoom(scale, zoom) {
		return	scale > 0 && scale >-zoom ? zoom :
				scale < 0 && scale < zoom ?-zoom : 0;
	}
	return function(zoom) { if( zoom ){
		var hZoom = getZoom( this._y, zoom ), vZoom = getZoom( this._x, zoom );
		if ( hZoom && vZoom ) {
			this._y += hZoom; this._x += vZoom;
		}
	}}
  }(),
  //放大
  zoomin: function() { this.scale( Math.abs(this._zoom) ); },
  //缩小
  zoomout: function() { this.scale( -Math.abs(this._zoom) ); },
  
  dragimg:function(){}
  
};


//拖动旋转扩展
ImageTrans.prototype._initialize = (function(){
	var init = ImageTrans.prototype._initialize,
		methods = {
			"init": function(){
				this._mrX = this._mrY = this._mrRadian = 0;
				this._mrSTART = $$F.bind( start, this );
				this._mrMOVE = $$F.bind( move, this );
				this._mrSTOP = $$F.bind( stop, this );
			},
			"initContainer": function(){
				$$E.addEvent( this._container, "mousedown", this._mrSTART );
			},
			"dispose": function(){
				$$E.removeEvent( this._container, "mousedown", this._mrSTART );
				this._mrSTOP();
				this._mrSTART = this._mrMOVE = this._mrSTOP = null;
			}
		};
	//开始函数
	function start(e){
		var rect = $$D.clientRect( this._container );
		this._mrX = rect.left ;
		this._mrY = rect.top+20 ;
		//this._mrRadian = Math.atan2( e.clientY - this._mrY, e.clientX - this._mrX ) - this._radian;
		this.eX=parseInt(e.clientX-rect.left);
		this.eY=parseInt(e.clientY-rect.top);
		this.sX=this.eX;
		this.sY=this.eY;
		$$E.addEvent( document, "mousemove", this._mrMOVE );
		$$E.addEvent( document, "mouseup", this._mrSTOP );
		if ( $$B.ie ) {
			var container = this._container;
			$$E.addEvent( container, "losecapture", this._mrSTOP );
			container.setCapture();
		} else {
			$$E.addEvent( window, "blur", this._mrSTOP );
			e.preventDefault();
		}
	};
	//拖动函数
	function move(e){
		//this.rotate( Math.atan2( e.clientY - this._mrY, e.clientX - this._mrX ) - this._mrRadian );
		this.sX=parseInt(e.clientX-this._mrX);
		this.sY=parseInt(e.clientY-this._mrY);
		this.dragimg();
		window.getSelection ? window.getSelection().removeAllRanges() : document.selection.empty();
	};
	//停止函数
	function stop(){
		$$E.removeEvent( document, "mousemove", this._mrMOVE );
		$$E.removeEvent( document, "mouseup", this._mrSTOP );
		if ( $$B.ie ) {
			var container = this._container;
			$$E.removeEvent( container, "losecapture", this._mrSTOP );
			container.releaseCapture();
		} else {
			$$E.removeEvent( window, "blur", this._mrSTOP );
		};
	};
	return function(){
		var options = arguments[1];
		if ( !options || options.mouseRotate !== false ) {
			//扩展钩子
			$$A.forEach( methods, function( method, name ){
				$$CE.addEvent( this, name, method );
			}, this );
		}
		init.apply( this, arguments );
	}
})();

//滚轮缩放扩展
//ImageTrans.prototype._initialize = (function(){
//	var init = ImageTrans.prototype._initialize,
//		mousewheel = $$B.firefox ? "DOMMouseScroll" : "mousewheel",
//		methods = {
//			"init": function(){
//				this._mzZoom = $$F.bind( zoom, this );
//			},
//			"initContainer": function(){
//				$$E.addEvent( this._container, mousewheel, this._mzZoom );
//			},
//			"dispose": function(){
//				$$E.removeEvent( this._container, mousewheel, this._mzZoom );
//				this._mzZoom = null;
//			}
//		};
//	//缩放函数
//	function zoom(e){
//		this.scale((
//			e.wheelDelta ? e.wheelDelta / (-120) : (e.detail || 0) / 3
//		) * Math.abs(this._zoom) );
//		e.preventDefault();
//	};
//	return function(){
//		var options = arguments[1];
//		if ( !options || options.mouseZoom !== false ) {
//			//扩展钩子
//			$$A.forEach( methods, function( method, name ){
//				$$CE.addEvent( this, name, method );
//			}, this );
//		}
//		init.apply( this, arguments );
//	}
//})();

function STP_ImgTs(sid,_src){
	var thumbs=$("#picImg_"+sid);
	var picbox=$("#picbox_"+sid);
	thumbs.hide(); picbox.show();
	this.obj=null;
	var container = $$("picMain"+sid);
	var src = _src;
	var options = {onPreLoad: function(){ container.style.backgroundImage = "url('/images/dirayImg/loading.gif')"; },onLoad: function(){ container.style.backgroundImage = ""; }};
	var it = new ImageTrans( container, options );
	it.load(src);
	$$("idVertical"+sid).onclick = function(){ it.vertical(); }
	$$("idHorizontal"+sid).onclick = function(){ it.horizontal(); }
	$$("idLeft"+sid).onclick = function(){ it.left(); }
	$$("idRight"+sid).onclick = function(){ it.right(); }
	$$("idReset"+sid).onclick = function(){ it.reset(); }
	$$("zoomin"+sid).onclick = function(){ it.zoomin(); }
	$$("zoomout"+sid).onclick = function(){ it.zoomout(); }
	$$("hideup"+sid).onclick=function(){thumbs.show();picbox.hide();it.dispose();}
}

var DragPic=function(ImgD){
    var image = new Image();
    image.src = ImgD.src;
    var width = ImgD.width;
    var height = ImgD.height;
    if(image.width > 0 && image.height > 0){
        if(image.width / image.height >= width / height){
            if(image.width > width){
                ImgD.width = width;
                ImgD.height = (image.height * width) / image.width;
            }
			else{
                ImgD.width = image.width;
                ImgD.height = image.height;
            }
        } 
		else{
            if(image.height > height){
                ImgD.height = height;
                ImgD.width = (image.width * height) / image.height;
            }
			else{
                ImgD.width = image.width;
                ImgD.height = image.height;
            }
        }
    }
}
