/* signup ajax events */

window.addEvent('domready', function() {
			
			new Asset.image('/images/ajax-loader.gif');
			
			$('emailField').addEvent('focus', function(){
				if (this.value=="enter your email address") {
					this.value = "";
				}
			});	
			
			$('emailField').addEvent('blur', function(){
				if (this.value=="") {
					this.value = "enter your email address";
				}
			});	
					
			var myAjax = new Ajax(url, {method: 'get'}).request();
			
			$('subscribe').addEvent('submit', function(e) {
				/**
				 * Prevent the submit event
				 */
				new Event(e).stop();
	 
				/**
				 * This empties the log and shows the spinning indicator
				 */
				$('signup').addClass('sending');
				
				var resultdiv = $('result').empty().addClass('sending');
			 
				/**
				 * send takes care of encoding and returns the Ajax instance.
				 * onComplete removes the spinner from the log.
				 */
				this.send({
					evalScripts: true,
					update: resultdiv,
					onComplete: function() {
						resultdiv.addClass('sent');
					}
				});
				
			});
		});