
// ********************
// ********************
function PollValidation(frm){
	aNotCheck = 0
	for (i=0; i<=frm.ctd25.value-1;i++){
		if (! frm.UserSelect[i].checked)
			aNotCheck = aNotCheck + 1
	}

	if (aNotCheck == frm.ctd25.value)
		return false

	PollSave()
	return false
	
}


// ********************
// ********************
function PollSave(){
	frm = document.frmPoll
	for (i=0; i<=frm.ctd25.value-1;i++){
		if (frm.UserSelect[i].checked)
			pollselect = i + 1
	}

	$.ajax({
		type: 'POST',
		data: "userselect=" + pollselect + "&uid79=" + frm.uid79.value + "&res45=" + frm.res45.value +"&nid7=" + frm.nid7.value,
		url: "savepoll.asp",
		error: function(XHRObject, options, errorThrown) {
			alert(XHRObject.responseText)
		},
		beforeSend: function() {
			$("#pollprogress").show()
		},
		success: function(resultback) {
			$("#pollresult").html(resultback)
		},
		complete: function() {
			$("#pollprogress").hide()
		}
	});
}

// ********************
// ********************
function ViewPollResult(tmp1,tmp2,tmp3,tmp4,pollcode,tmp5){
	$.ajax({
		type: 'POST',
		data: "code=" + pollcode,
		url: "viewpoll.asp",
		error: function(XHRObject, options, errorThrown) {
			alert(XHRObject.responseText)
		},
		beforeSend: function() {
			$("#pageloading").show()
		},
		success: function(resultback) {
			$("#pagecontent").html(resultback)
		},
		complete: function() {
			$("#pageloading").hide()
		}
	});	
}

