
/**
 * 
 */
$(document).ready(function() {
	
	
	$('.txt_box').focus(function() {
		if($(this).attr('value') == $(this).attr('title')) {
			$(this).attr('value', '');
		}
	});
	
	$('.txt_box').blur(function() {
		if($(this).attr('value') == '') {
			$(this).attr('value', $(this).attr('title'));
		}
	});
	
	$('.submit_form').click(function() {
		$(this).parent().submit();
	});
	
	
	$('#contact_form').submit(function() {

		var reqElements = jQuery.makeArray($(this).find('.required'));
		$(this).find('.error').empty();
		
		var noerrors = true;
		for(var i=0;i<reqElements.length; i++){
			if(reqElements[i].value.length == 0) {
				$('#' + reqElements[i].name +  '_error').text(reqElements[i].name + ' is required!');
				noerrors = false;
			}

		}
		return noerrors;
	});
	
	
});

