function decrypt (Str) {
   var s = new String;
   var i;
   for (i=0; i<Str.length; i+=2) {
      s = s + String.fromCharCode (parseInt (Str.substr(i ,2), 16)^(i/2));
   }
   return s;
}

function mailme(hash) {
	hash = decrypt(hash);
	mailadd = "mailto:" + hash;
	window.location = mailadd;
}

this.imagePreview = function(){	
		
		xOffset = 65;
		yOffset = -30;
		
	$("a.preview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		//var c = (this.t != "") ? "<br />" + this.t : "";
		$("body").append("<div id='preview'><div class='img'>"+ this.t +"</div><div class='bottom'></div></div>");								 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$("a.preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


// starting the script on page load
$(document).ready(function(){
	imagePreview();
});