$(window).load(function() {
	$('.gform_fields li').each(function() {
		if($(this).hasClass('gfield_error')) {
			$(this).find('input').css('color', 'red');
		}
	});
	
	// captcha hardcoded hacks
	if($('#field_6_6').hasClass('gfield_error')) {
			$('#input_input_6_6').val('Wrong code');
	}
	
	if($('#field_3_21').hasClass('gfield_error')) {
			$('#input_input_3_21').val('Wrong code');
	}
	
	if($('#field_7_21').hasClass('gfield_error')) {
			$('#input_input_7_21').val('Wrong code');
	}
	
	if($('.validation_error').length) {
		var reset_pos = $('#reset_button_div').position();
		var submit_pos = $('.gform_footer .gform_image_button').position();
		var captcha_desc_pos = $('.captcha_desc').position();

			// get current top and increase because of error msg
		if(reset_pos) {
			reset_pos = reset_pos.top + 12 + 'px';
			$('#reset_button_div').css('top', reset_pos);
		}
		if(submit_pos) {
			submit_pos = submit_pos.top + 12 + 'px';
			$('.gform_footer .gform_image_button').css('top', submit_pos);
		}
		if(captcha_desc_pos) {
			captcha_desc_pos = captcha_desc_pos.top + 12 + 'px';
			$('.captcha_desc').css('top', captcha_desc_pos);
		}
		
	}
	
}); 
