ratingCommentJS={
	prepareSubmit:function (form)
	{
	   
		reWhiteSpace = new RegExp(/^\s+$/);		
		if(form.nameField != null && reWhiteSpace.test(form.nameField.value) || form.nameField.value == ""){ Common.formErrorHandleClient("nameField",Common.errorMessages["ADD_RATING_REQUIRED_FIELD_ENTER_NAME"],form.nameField,'addRatingCommentErrorSpotDiv'); return;}
		if(form.cityField != null && reWhiteSpace.test(form.cityField.value) || form.cityField.value == ""){ Common.formErrorHandleClient("cityField",Common.errorMessages["ADD_RATING_REQUIRED_FIELD_ENTER_CITY"],form.cityField,'addRatingCommentErrorSpotDiv'); return;}
		if(form.commentField != null && reWhiteSpace.test(form.commentField.value) || form.commentField.value == ""){ Common.formErrorHandleClient("commentField",Common.errorMessages["ADD_RATING_REQUIRED_FIELD_ENTER_COMMENT"],form.commentField,'addRatingCommentErrorSpotDiv'); return;}
		
		if(form.checkAgreeField != null && !form.checkAgreeField.checked){ Common.formErrorHandleClient("checkAgreeField",Common.errorMessages["ADD_RATING_REQUIRED_FIELD_CHECK_AGREE"],form.commentField,'addRatingCommentErrorSpotDiv'); return;}
				
		if(form.simplecaptcha_response_field != null && reWhiteSpace.test(form.simplecaptcha_response_field.value) || form.simplecaptcha_response_field.value == ""){ Common.formErrorHandleClient("simplecaptcha_response_field",Common.errorMessages["ADD_RATING_REQUIRED_FIELD_ENTER_CAPTCHA"],form.simplecaptcha_response_field,'addRatingCommentErrorSpotDiv'); return;}
				
		cursor_wait();
		wc.service.invoke('AddRatingCommentCmd');
 
		//do a little here
		form.simplecaptcha_response_field.value = "";
		Common.formErrorHandleClientClear('addRatingCommentErrorSpotDiv');
	},
	
	setRating:function(ratingNumber){
		var commentForm = document.getElementById('addRatingCommentForm');
		var ratingField = commentForm.ratingField;
		
		ratingField.value = ratingNumber;
		var addRatingCommentFirstRatingStar = document.getElementById('addRatingCommentFirstRatingStar');
		
		addRatingCommentFirstRatingStar.className = 'colored_star';
		
		if(ratingNumber == 1)
			addRatingCommentFirstRatingStar.style.width = '20px';
		else if(ratingNumber == 2)
			addRatingCommentFirstRatingStar.style.width = '40px';
		else if(ratingNumber == 3)
			addRatingCommentFirstRatingStar.style.width = '60px';
		else if(ratingNumber == 4)
			addRatingCommentFirstRatingStar.style.width = '80px';
		else if(ratingNumber == 5)
			addRatingCommentFirstRatingStar.style.width = '100px';
		
		
	},
	
	agreeWithComment:function(ratingId,yes){
		cursor_wait();
		var params = [];
		params.ratingId = ratingId;
		params.yes = yes;
		wc.service.invoke('AgreeWithCommentCmd',params);
 
	}
}
