function fbshare() 
{
	var u=location.href;
	var t = $('title').text();
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'fbshare','toolbar=0,status=0,width=626,height=436');
	return false;
}


(function($) {

	$.fn.prompt = function(textContainer, labelContainer) {
		return $(this).each(function() {
		
			var root = $(this);
			var input = root.find(textContainer);
			var label = root.find(labelContainer);
			var prompt =
                $("<span />")
                 .addClass("prompt")
                 .insertAfter(label);
			label.show().appendTo(prompt);
			
			var pos = input.position();
			prompt.css('left', pos.left).css('top', pos.top);
			input.bind('click focus', function() {
				prompt.hide();
				if ($(this).val() == label.text()) $(this).val('');

			}).bind('blur', function() {
				if ($(this).val() == label.text() || $(this).val() == '') {
					prompt.show();
					$(this).val('');
				}
			});
			prompt.click(function() {
				$(this).hide();
				input.focus();
			});

			$(function() {
				if (input.val() != '') prompt.hide();
			});

		});
	};
	
	$.fn.EventCalendar = function(heading, row) {
	
		return $(this).each(function() {
			var root = $(this);
			var url = window.location.toString();
			var index = url.indexOf('#');			
			var selectedRow = index >= 0 ? root.find('#' + url.substring(index+1, url.length)) :  "";						
			var headings = root.find(heading);
			var rows = root.find(row);
			rows.hide();	

			if(selectedRow.length) {
				rows.filter('[CLASS *=' + selectedRow.attr('class') + ']').show();
			}
			
			headings.click(function() {				
				var affectedRows = rows.filter('.' + $(this).attr('MonthRows'));
				affectedRows.filter(':visible').length < affectedRows.length ? affectedRows.show() : affectedRows.hide();
			});
			
			$(function() {
				if(!selectedRow.length)
				rows.filter('.' + headings.eq(0).attr('MonthRows')).show();				
			});
			
			
		});
	};

})(jQuery);
