	  
		
this.imagePreview = function(){	
	    var xOffset = 0;
		var yOffset = 0;
		var xo = 10;
		var yo = 15;
		var wo = 250;
		var ho = 270;
		var h  = 0;
		var w  = 0;
	
	$("a.imgroll").hover(function(e){
		h = $(window).height();
		w = $(window).width();
		var u = "/img/assets/rollover/" +this.rel+".jpg";
				
		this.t = this.title;
		this.title = "";	

		xOffset = ( ( e.pageX + wo) >  w ) ? (wo+15)*-1 : xo;
		yOffset = ( ( e.pageY + ho) >  h ) ? (ho-(h-e.pageY))*-1 : yo;
		var left = e.pageX + xOffset;
		var top  = e.pageY + yOffset;
						
		var c = (this.t != "") ? this.t : "";
	
		$("body").append(
		"<div id='preview'><span>"+ c +"</span><div class='dwrapper'><img src='"+u+"' alt='"+this.title+"'></div></div>"
		);								 
		$("#preview")
			.css("top",top + "px")
			.css("left",left + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
		
    });	
	$("a.imgroll").mousemove(function(e){
		
		h = $(window).height();
		w = $(window).width();
		xOffset = ( ( e.pageX + wo) >  w ) ? (wo+15)*-1 : xo;
		yOffset = ( ( e.pageY + ho) >  h ) ? (ho-(h-e.pageY))*-1 : yo;
		
		var left = e.pageX + xOffset;
		var top  = e.pageY + yOffset;
			
		$("#data").html(e.pageX +" "+ yOffset)
		
		$("#preview")
			.css("top",top + "px")
			.css("left",left+ "px");
	});		
	
	var vid = 0;
	
	//homebrewaddition
	$("a.vtools").mouseover(function(e){
		var n  = $(this).position();
		xo  = n.left//70;
		yo  = n.top//75;
		vid = this.rel;
		$("#vtool")
			.css("top",yo + "px")
			.css("left",xo + "px")
			.fadeIn("fast");	
		
	});
	$("#vtool").mouseover(function(){
		
		$("#vtool")
			.css("top",1 + "px")
			.css("left",1 + "px")
			.fadeOut("fast");
		
		$("#vtoolpanel")
			.css("top",yo + "px")
			.css("left",xo + "px")
			.fadeIn("fast");
			
		$("#vtoolpanel h6").html(vid)
			
		$("#vtoolpanel a.close").click(function(){
			$("#vtoolpanel").fadeOut("fast");
		});	
		$("#fmyfreevector").change(function(){
			$("#vtoolpanel a.close").toggle();
			$("#ajaxloader").toggle();
		});	
	});
	
};

$(document).ready(function(){
	imagePreview();
	
});
