$(document).ready(function(){

	/* Input default texts */
	$("input[type='text']").each(function(){
		var dval = $(this).attr("defaultvalue");
		
		// Enter the default text into the value area
		$(this).blur(function(){
			if ($(this).val() == '')
			{
				$(this).val(dval);
			}
		});
		
		// Clear the defaultvalue on focus
		$(this).focus(function(){	
			if (dval == $(this).val())
			{
				$(this).val('');
			}
		});
		
		// Trigger a blur event to setup the default values
		$(this).blur();
	});

	// formatting Guide toggle
	$(".slide-toggle").click(function(){
		var state = $(this).text();
		
		if (state == "Show Formatting Guide")
		{
			$(this).text("Hide Formatting Guide");
		} else 
		{
			$(this).text("Show Formatting Guide");
		}
		
		$("#formatting-guide").slideToggle();
		return false;
	});
	
	// Initialise jQuery WYSIWYG:
	//$(".wysiwyg").markItUp(mySettings);

	// Lightbox galleries
	$("#gallery a").lightBox({
		fixedNavigation:	true,
		imgBtnClose:		'http://mobass.local/public/images/lightbox-btn-close.gif',
		imgBtnNext:			'/public/images/lightbox-btn-next.gif',
		imgBtnPrev: 		'/public/images/lightbox-btn-prev.gif',
	});
});

