(function($){
	$.fn.Zoomer=function(b){
		var c=$.extend({speedView:200,speedRemove:400,debug:false,animSwitch:false,marginTop:0,marginLeft:0,ZoomWidth:0,ZoomHeight:0,width:0,height:0,padding:0},b);
		var d=$.extend(c,b);
		function e(s){
			if(typeof console!="undefined"&&typeof console.debug!="undefined"){
				console.log(s)
			}else{
				alert(s)
			}
		}
		if(d.speedView==undefined||d.speedRemove==undefined){
			e('speedView: '+d.speedView);
			e('speedRemove: '+d.speedRemove);
			return false
		}
		if(d.debug==undefined){
			e('speedView: '+d.speedView);
			e('speedRemove: '+d.speedRemove);
			return false
		}
		if(typeof d.speedView!="undefined"||typeof d.speedRemove!="undefined"){
			if(d.debug==true){
				e('speedView: '+d.speedView);
				e('speedRemove: '+d.speedRemove);
				e('altAnim: '+d.altAnim);
				e('speedTitle: '+d.speedTitle)
			}
			$(this).hover(function(){
				$(this).css({'z-index':'10'});
				if(d.animSwitch==false){
					$(this).find('img').addClass("hover").css({marginTop:'-'+d.marginTop+'px',marginLeft:'-'+d.marginLeft+'px',top:'50%',left:'50%',width:d.ZoomWidth+'px',height:d.ZoomHeight+'px',padding:d.padding+'px'})
				}else{
					$(this).find('img').addClass("hover").stop().animate({marginTop:'-'+d.marginTop+'px',marginLeft:'-'+d.marginLeft+'px',top:'50%',left:'50%',width:d.ZoomWidth+'px',height:d.ZoomHeight+'px',padding:d.padding+'px'},d.speedView);
				}
				//标题动画
				//if(d.altAnim==true){
					//var a=$(this).find("img").attr("alt");
					//if(a.length!=0){
						//$(this).prepend('<span class="title">'+a+'</span>');
						//$('.title').animate({marginLeft:'-42px',marginTop:'90px'},d.speedTitle).css({'z-index':'10','position':'absolute','float':'left'})
					//}
				//}
			},function(){
				$(this).css({'z-index':'0'});
				if(d.animSwitch==false){
					$(this).find('img').removeClass("hover").css({marginTop:'0',marginLeft:'0',top:'0',left:'0',width:d.width+'px',height:d.height+'px',padding:'0px'});
				}else{
					$(this).find('img').removeClass("hover").stop().animate({marginTop:'0',marginLeft:'0',top:'0',left:'0',width:d.width+'px',height:d.height+'px',padding:'0px'},d.speedRemove);
				}
				//$(this).find('.title').remove()
			})
		}
	}
})(jQuery);
