(function($) {
	
	$.fn.feedBack = function(options) {
		
		//Override Default Properties if Options are Set
		var settings = $.extend({},$.fn.feedBack.defaults,options);
		var dom = {};
		
		//Plugin Constructor
		return this.each(function() {
			$(this).click(function() {
				dom.overlay = $('<div />')
				dom.overlay
					.attr('id','feedBack-overlay')
					.css({
						'width' : '100%',
						'height' : '100%',
						'position' : 'absolute',
						'z-index' : '9999',
						'top' : '0px',
						'left' : '0px'
					})
					.click(function() {
						$.each(dom,function(i,e) {
							$(e).remove();
						});
					});
				dom.popup = $('<div />')
				dom.popup
					.attr('id','feedBack-popup')
					.css({
						'position' : 'absolute',
						'z-index' : '9999',
						'bottom' : '50px',
						'left' : '80px',
						'width' : '333px',
						'height' : '510px',
						'background-image' : 'url(\'' + settings.backgroundImage + '\')',
						'border-radius' : '10px',
						'-moz-border-radius' : '10px',
						'-webkit-border-radius' : '10px'
					});
				dom.close = $('<img />')
				dom.close
					.attr('id','feedBack-close')
					.attr('width','18')
					.attr('height','18')
					.attr('src',settings.closeImage)
					.css({
						'position' : 'absolute',
						'right' : '5px',
						'top' : '5px'
					})
					.hover(
						function() {
							$(this).css('cursor','pointer')
						},function() {
							$(this).css('cursor','default');
						}
					)
					.click(function() {
						$.each(dom,function(i,e) {
							$(e).remove();
						});
					})
					.appendTo(dom.popup);
				dom.form = $('<div />')
				dom.form
					.attr('id','feedBack-form')
					.load(settings.formTemplate)
					.appendTo(dom.popup);
				$('body')
					.append(dom.overlay)
					.append(dom.popup);
				return false;
			});
		});
		
	};
	
	//PROPERTIES
	$.fn.feedBack.defaults = {
		backgroundImage : '',
		closeImage : '',
		formTemplate : ''
	};
	
	//METHODS
	
}) (jQuery);
