function CheckEmail( email ) {
	
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (!filter.test(email.value)) {
		alert( 'Please provide a valid email address' );
		email.focus;
	}
	
}



function CheckForm()
{
	var error_msg;
	var error_div = document.getElementById( "error" );
	var inputfield;
	var requiredfields = new Array( 'name', 'email', 'comments'  ); 
	
	var validated = true;
	for( var index = 0; index < requiredfields.length; index++ )
	{
		
		inputfield = document.getElementById( requiredfields[ index ] );
		if( inputfield.value == '' )
		{
			inputfield.style.backgroundColor = "#F9E5E5";
			validated = false;
		
		} else {
			
			inputfield.style.backgroundColor = "#FFFFFF";
		}
	
	}
	
	if( validated )
	{
		error_msg = document.createTextNode( "Submiting your request" );
		error_div.replaceChild( error_msg, error_div.firstChild );
		return true;
		
	} else {
		
		error_msg = document.createTextNode( "Please enter your name, a valid email and a message." );
		error_div.replaceChild( error_msg, error_div.firstChild );
		return false;

		
	}
	
	
}

function clearFld( fld ) {
	
	fld.value = '';
}

function subscribe() 
{
	
	var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test($("#email_fld").attr( 'value' ))) {
		//$.post("subscribe.php", { email: $("email_fld").value } );
		//$("#email_fld").attr( 'value', 'sent' );
		
		return true;
		
	} else {
		
		return false;
	}
}


$(document).ready(function() {
	
	$(this).find(".button").each(function(i) 
  	{

		$(this).mouseover(function() 
		{ 	
			var src = this.src;
			this.src = src.replace( '_off.', '_on.' );	 
		});
		 
		$(this).mouseout(function()
		{	
			var src = this.src;
			this.src = src.replace( '_on.', '_off.' );	
		});
		
		$(this.parentNode).focus(function () 
		{	
		 	var img = this.firstChild;
			var src = img.src;
			img.src = src.replace( '_off.', '_on.' );	 
	  	});
	  	 
	  	$(this.parentNode).blur(function () 
	  	{	
	  		var img = this.firstChild;
			var src = img.src;
			img.src = src.replace( '_on.', '_off.' );	
		});
		
		
  	});

	$("#coaching_mp3").mouseover(function() 
	{ 
		$("#coming_soon").show();
	});
	
	
	$("#coaching_mp3").mouseout(function() 
	{ 
		$("#coming_soon").hide();
	});
		
    
});
