if (typeof window.jQuery != 'undefined') 
{
	document.documentElement.className = 'js';

	$(function()
	{	
		var myURL = "swf/player.swf";	
		var myFlashVars =
		{
		}
		
		var myParams = 
		{
			menu: "false"
		}

		$("div#soundplayer").html( "<div id='flash-content-container'></div>" );			
		swfobject.embedSWF( myURL, "flash-content-container", "0px", "0px", "9", false, myFlashVars, myParams );	
	
		$("#signup-form").submit( submitSignup );
		$('#container').fadeIn( 300 ); 
	});
}		


function submitSignup()
{
    var myAddress = $("#email-input").val();
	var myExpression = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;

    if( myAddress != "" && myExpression.test(myAddress) ) 
	{
		$("#signup").fadeOut( 300, function() 
		{
			var myParams = { email: myAddress };
			$.post( "services/submit.php", myParams, submitCompleteHandler );
		});
	}
	else
	{
		 $("#email-input").css({color:"rgb(218, 0, 0)"});
	}
}


function submitCompleteHandler( event )
{
	setTimeout( function() 
	{ 
		$("p#feedback-description").fadeIn( 300 ) 
	}, 100 );
}
