/* used to update the usefullness of a kb article by sending the users yes or no choice to the ajaxcalls.cfm page for db calls
and a response, this also updates the number instantly on the page depending on the users choice
*/

function updateishelpful(key, value) {
	//if (key == null || value == null) { return false; }
	
$.ajax({
			
			url: "ajaxcalls.cfm?call=updateishelpful&key="+key+"&ishelpful="+value,
			dataType: 'html',
			method: 'get',
			success: function(transport) {
				
				$('#helpfulvote').fadeOut();
				
				old = $('#votedtotalcount').text();
				old = parseInt(old)+1;
				$('#votedtotalcount').text(old);
				
				if (transport == 'yesupdated') {
				yesvote = $('#votedyescount').text();
				yesvote = parseInt(yesvote)+1;
				$('#votedyescount').text(yesvote);
				}
				
						
				} 
		});

}

function getradiovalue(name) {
	var e = document.getElementsByName(name);
	for (var i=0; i < e.length; i++) {
		if (e[i].checked) { return e[i].value; };
	};
}