var ACRating = {
	'send' : function(ratingNum) {
		if(document.ratingform.elements[ratingNum]!=undefined) {
			document.ratingform.elements[ratingNum].checked = true;
			document.ratingform.setAttribute('id', 'ratingform');
			var CommentText = document.commentForm.commentBox.value;
			if (CommentText == 'Click to rate this page. We appreciate your feedback and value your opinion! How can we improve this page or other visp.net services?') {
				CommentText = '';
			}
			var remoteIP = document.ratingform.remoteIP.value;
			var cmntMail = document.commentForm.cmntMail.value;
			var contactMe = document.commentForm.contactMe.checked;
			if (ratingNum == '6' && CommentText != '') {
				ACUtil.reportView('ratingform', ACRating, ratingNum, CommentText, remoteIP, cmntMail, contactMe);
				$('comment').style.display = "none";
			} else if (ratingNum != '6') {
				ACUtil.reportView('ratingform', ACRating, ratingNum, CommentText, remoteIP, cmntMail, contactMe);
				var thisStar = 'star'+ratingNum;
				var i = 0;
				for (i=1;i<=5;i++) {
					var eachStar = 'star'+i;
					if($(eachStar).hasClassName('current-rating')) {
						$(eachStar).removeClassName('current-rating');
					}
				}
				$(thisStar).addClassName('current-rating');
				$('comment').style.display = "block";
			}
		} else {
			ACRating.error("There was a problem submitting the rating. Language not supported? Please try again!");
		}
	},
	'done' : function(responseText, rating) {
		if(responseText=="Success") {
			$('rating').style.display = "block";
			if (rating != '6') {
				$('comment').style.display = "block";
			}
		} else {
			ACRating.error("There was a problem submitting the rating. Please try again!");
		}
	},
	'error' : function(errorMessage) {
		alert(errorMessage);
		$('comment').style.display = "block";
		$('rating').style.display = "block";
	}
};
