//-----------------------------------------------------------------------
//
// Theme: 		 JQ API of Michel Frömmgen Portfolio | http://www.michel.froemmgen.de
// Version: 	 1.0.2
// Last Update:  2010.10.29
// Author: 		 Michel Frömmgen
// URL: 	 	 http://www.michel-froemmgen.de
// 
//-----------------------------------------------------------------------


$(document).ready(function() {
	

// Fancybox Settings ---------------------------------------------------- 
$("a.showcase").fancybox({
	//'titlePosition' : 'false',
	'titleShow'		: false,
	'transitionIn'	: 'elastic',
	'transitionOut'	: 'elastic',
	'autoScale'		: false,	
	});

});
// End of Fancybox Settings ---------------------------------------------



// Close Thanks ---------------------------------------------------------
$("#closeThx").mouseover(function () {
	$("#messagesent").fadeOut("slow");
	});
$("#messagesent").click(function () {
	$("#messagesent").fadeOut("slow");
	});
// End of Close Thanks --------------------------------------------------



// imgFade --------------------------------------------------------------
jQuery(document).ready(function(){
  jQuery("#portfolio a img").stop().fadeTo(0, 0.8);
  
});

	$("#portfolio a").mouseover(function(){
  		$(this).children("a img").stop().animate({ 
   			 opacity: 1
  		}, 500 );
	});
	
		$("#portfolio a").mouseleave(function(){
  		$(this).children("a img").stop().animate({ 
   			 opacity: 0.9
  		}, 500 );
	});
// End of imgFade -------------------------------------------------------



// Tooltip --------------------------------------------------------------
(function($) {

	$.fn.easyTooltip = function(options){
	  
		// default configuration properties
		var defaults = {
			xOffset: 3 ,		
			yOffset: 27,
			tooltipId: "easyTooltip",
			clickRemove: true,
			content: "",
			useElement: ""
		}; 
			
		var options = $.extend(defaults, options);  
		var content;
				
		this.each(function() {  				
			var title = $(this).attr("title");				
			$(this).hover(function(e){											 							   
				content = (options.content != "") ? options.content : title;
				content = (options.useElement != "") ? $("#" + options.useElement).html() : content;
				$(this).attr("title","");									  				
				if (content != "" && content != undefined){			
					$("body").append("<div id='"+ options.tooltipId +"'>"+ content +"</div>");		
					$("#" + options.tooltipId)
						.css("position","absolute")
						.css("top",(e.pageY - options.yOffset) + "px")
						.css("left",(e.pageX + options.xOffset) + "px")						
						.css("display","none")
						.stop().fadeIn("slow")
				}
			},
			function(){	
				$("#" + options.tooltipId).remove();
				$(this).attr("title",title);
			});	
			$(this).mousemove(function(e){
				$("#" + options.tooltipId)
					.css("top",(e.pageY - options.yOffset) + "px")
					.css("left",(e.pageX + options.xOffset) + "px")					
			});	
			if(options.clickRemove){
				$(this).mousedown(function(e){
					$("#" + options.tooltipId).remove();
					$(this).attr("title",title);
				});				
			}
		});
	  
	};

})(jQuery);
// End of Tooltip -------------------------------------------------------


