/*
jQUERY
--------------------------------------------------*/
$(document).ready(function() {
		
	$('a[href="#"]').click(function() {
		alert('This link has not been implemented yet.');
		
		return false;
	});
	
	$("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'fast',
		opacity: 0.60,
		theme: 'dark_square'
	});
	
	$('form').submit(function() {
		$this = $(this);
		
		if ($('input:submit',$this).metadata().disabledText) {
			$('input:submit',$this).next('a').remove();
			
			$('input:submit',$this).attr('disabled','disabled').val($('input:submit',$this).metadata().disabledText).addClass('disabled');
		}
	});
	
	$('div#content-sub form p.text input').toggleVal('defaultval');
		
});

jQuery.fn.toggleVal = function(focusClass) {
	this.each(function() {
		$(this).focus(function() {
			// clear value if current value is the default
			if($(this).val() == this.defaultValue) { $(this).val(""); }
			
			// if focusClass is set, add the class
			if(focusClass) { $(this).addClass(focusClass); }
		}).blur(function() {
			// restore to the default value if current value is empty
			if($(this).val() == "") {
				$(this).val(this.defaultValue);
				
				// if focusClass is set, remove class
				if(focusClass) { $(this).removeClass(focusClass); }
			}
		});
	});
}