$( document ).ready( function(){
	$('.blink')
		.focus(function(){
			if( $(this).attr('value') == $(this).attr('title') ) {
				$(this).attr({ 'value': '' });
			}
		})
		.blur(function(){
			if( $(this).attr('value') == '' ) {
				$(this).attr({ 'value': $(this).attr('title') })
			}
		});
		
	$('.subscribe-button').click(function(){
		var f = $('#email-field');
		var v = f.attr('value');
		
		if( /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(v) == false ) {
			alert('Please, enter valid email address!');
			
			f.focus();
		}else {
			document.subscribe_form.submit();
		}
		return false;
	});
});