(function($){

	$.fn.customPopup = function(options){
	
			/* Setup the options for the tooltip that can be
			   accessed from outside the plugin              */
			var defaults = {
				title: "Your Popup Title",
				message: "Pers login.",
				url: "",
				showfaces: true,
				timeout: 25,
				closeable: true,
				wait: 0,
				lang: "en"
			};
			
			// Extend options and apply defaults if they are not set
			var options = $.extend(defaults, options);
			
			
			
			// Get window width and height to center the pop up
				var windowWidth = document.documentElement.clientWidth;
				var windowHeight = document.documentElement.clientHeight;
				var popupHeight = $("#fblikepop").height();
				var popupWidth = $("#fblikepop").width();
				
				// Simple division will let us make sure the box is centered on all screen resolutions
				$("#fblikepop").css({"position": "absolute","top": windowHeight / 2 - popupHeight / 2,"left": windowWidth/2-popupWidth/2});
				$("#fblikebg").css({"height": windowHeight});
				
				// Check if the closeable is set to true
				if(defaults.closeable == true){
								
					// If so, display a close button for the pop up
					$("#closeable").html('<a id="fbflush" class="fbflush" onClick="fbLikeDump();" href="#">Sluit</a>');
					
				}
			
				// Set the background shadow active - higher opactity = darker background shadow
				$("#fblikebg").css({"opacity": "0.5"});
				
				// Fade in the background shadow
				$("#fblikebg").fadeIn("slow");
				
				// Fade in the popup box
				$("#fblikepop").fadeIn("slow");
	
	}; // End Main Function

})(jQuery); // End Plugin




function fbLikeDump(action){
			
	// Fade out the background shadow
	jQuery("#fblikebg").fadeOut("slow");
			
	// Fade out the pop up itself
	jQuery("#fblikepop").fadeOut("slow");
		
}	

