/**
 * PShelper.com javascript core
 * @author Derek Decker derek@visioncourse.com
 * @author Andrew Maxwell andrew@visioncourse.com
 * @author Bryant Young bryant@visioncourse.com
 *
 * All 3rd Party Scripts Are Documented
 **/

var trace = function(t){ if("console" in window)console.log(t); }
    
$(document).ready(function(){
    
	$('.placeholder').each(function(){
		var origValue = $(this).val(); 
		$(this).focus(function(){ if($(this).val() == origValue) { $(this).val(''); } });
		$(this).blur(function(){ if($(this).val() == '') { $(this).val(origValue); } });
	});
	
	/**
	* OPEN EXTERNAL LINKS IN NEW WINDOW
	* (Looks for the 'rel' attribute with a value of 'external' on clicked links)
	* @author Andrew Maxwell andrew@visioncourse.com
	* @version 1.0
	*/
	$('a[rel="external"]').click(function(){
		window.open($(this).attr('href'),'_blank');
		return false;
	});
	
	$('a[href="#"], area[href="#"]').click(function(event){ event.preventDefault(); return false; });
	$("input").each(function(){ $(this).addClass(this.type); });
	
	$('img').each(function() {
		if (!$(this).attr('alt')) {
			$(this).attr('alt',$(this).attr('src'));
		}
		if (($(this).attr('alt')) && (!$(this).attr('title')) ) {
			$(this).attr('title',$(this).attr('alt'));
		} 
	});
	
	$('#specials-signup').bind('click',function(){
		$(this).attr('href','http://www.facebook.com/pages/New-York-NY/MySpa-2-GO/114998045182831').text('Become a fan to stay posted on our special offers on our fb page!');
		$(this).unbind('click');
		return false;
	})
});	
