$(function() {
	
		////Request Portfolio form behavior////
		
		//--form usability behavior
    $('input#form-email').keypress(function() {
		var email = $(this).val();
		
			if (email == "Enter your email") {
				$(this).css('color', '#585858');
				$(this).val('');
			}
      });

	  $('input#form-email').blur(function() {
		var email = $(this).val();
		if (email == "" || email == "Enter your email") {
			$(this).val('Enter your email');
			$(this).css('color', '#b8b8b8');
			return false;
		}
		});
		
		$('input#form-email').focus(function() {
			var email = $(this).val();
			if (email == "Enter your email") {
			$(this).css('color', '#b8b8b8');	
			}
		});
		

		//--submit behavior
		$("input#form-submit").click(function() {
			
			// validate
			var email = $('input#form-email').val();
			if (email == "" || email == "Enter your email") {
				$('input#form-email').css('border-color','#ec008c');
				$('input#form-email').css('color','#ec008c');
				$('input#form-email').focus();
				return false;
			}
			
			// submit
			dataString = 'form-email=' + email;
			$.ajax({
				type:"POST",
				url: "email.php",
				data: dataString,
				success: function() {
					$('aside.form').fadeOut('fast', function() {$('aside.thankyou').fadeIn('slow');} );
					//alert("done");
				}
			});
			
			//alert(dataString);
			return false;
			
		});
		
		

 });
