//**************************************************************
// jQZoom allows you to realize a small magnifier window,close
// to the image or images on your web page easily.
//
// jqZoom version 1.2
// Author Doc. Ing. Renzi Marco(www.mind-projects.it)
// Released on Dec 05 2007
// i'm searching for a job,pick me up!!!
// mail: renzi.mrc@gmail.com
//**************************************************************

(function($){

		$.fn.jqueryzoom1 = function(options){

		var settings1 = {
				xzoom1: 200,		//zoomed width default width
				yzoom1: 200,		//zoomed div default width
				offset1: 10,		//zoomed div default offset
				position1: "right"  //zoomed div default position,offset position is to the right of the image
			};

			if(options) {
				$.extend(settings1, options);
			}

            var noalt1 ='';

		$(this).hover(function(){

           
		    var imageLeft1 = $(this).get(0).offsetLeft1;
		    var imageRight1 = $(this).get(0).offsetRight1;
		    var imageTop1 =  $(this).get(0).offsetTop1;
		    var imageWidth1 = $(this).get(0).offsetWidth1;
		    var imageHeight1 = $(this).get(0).offsetHeight1;

		    var bigimage1 = $(this).attr("alt");
                noalt1 = $(this).attr("alt");
                $(this).attr("alt",'');
                

		    if($("div.zoomdiv").get().length == 0){

		    $(this).after("<div class='zoomdiv'><img class='bigimg' src='"+bigimage1+"'/></div>");

		    }

		    if(settings1.position1 == "right"){

		    leftpos1 = imageLeft1 + imageWidth1 + settings1.offset1;

		    }else{

		    leftpos1 = imageLeft1 - settings1.xzoom1 - settings1.offset1;

		    }

		    $("div.zoomdiv").css({ top1: imageTop1,left1: leftpos1 });

		    $("div.zoomdiv").width(settings1.xzoom1);

		    $("div.zoomdiv").height(settings1.yzoom1);

		    $("div.zoomdiv").show();


					//$(document.body).mousemove(function(e){
//
//				    var bigwidth = $(".bigimg").get(0).offsetWidth;
//
//				    var bigheight = $(".bigimg").get(0).offsetHeight;
//
//				    var scaley ='x';
//
//				    var scalex= 'y';
//
//
//				    if(isNaN(scalex)|isNaN(scaley)){
//
//				    var scalex = Math.round(bigwidth/imageWidth) ;
//
//				    var scaley = Math.round(bigheight/imageHeight);
//
//				    }
//
//					mouse = new MouseEvent(e);
//
//
//
//					scrolly = mouse.y - imageTop - ($("div.zoomdiv").height()*1/scaley)/2;
//
//					$("div.zoomdiv").get(0).scrollTop = scrolly * scaley  ;
//
//				    scrollx =    mouse.x - imageLeft - ($("div.zoomdiv").width()*1/scalex)/2;
//
//					$("div.zoomdiv").get(0).scrollLeft = (scrollx) * scalex ;
//
//
//				    });
		    },function(){
                   $(this).attr("alt",noalt1);
		       $("div.zoomdiv").hide();
		       $(document.body).unbind("mousemove");
		       $(".lenszoom").remove();
		       $("div.zoomdiv").remove();
		    });

		}

})(jQuery);
//<!--
//function MouseEvent1(e) {
//this.x1 = e.pageX1
//this.y1 = e.pageY1
//}-->


