	/*	http://192.168.0.205/projects/orkaya/fund/add	*/

$(document).ready(function(){
	//$().ajaxStart($.blockUI).ajaxStop($.unblockUI);
});

function getoptionidmodul(optionid){
	var optionid = optionid;
	document.getElementById("polloptionid").value = optionid;
	}

function pollsubmitmodule(pollid){
		var poll_option_id = document.getElementById("polloptionid").value;
		var error = "";
		var success = 0;	
		$("#errorVote").html("");		  	
		if(poll_option_id!=""){
				$.post(SITEROOT + '/polls/sentpoll/',{poll_option_id:poll_option_id},function(data){ 
							if(data.success == 1){
							jQuery.facebox({ajax:SITEROOT + '/polls/sentoption/success/' + '1'});
							}
					},'json');
			$("#submitpollvote").html("");
		}
      else{
				error = "Please select any one option"; 	
				$("#errorVote").html(error);
				$("#errorVote").addClass("error");
		}
}

function pollresultmodule(pollid){
				var pollid = pollid;		
			
				if(pollid != ""){
					jQuery.facebox({ajax:SITEROOT + '/polls/vote/pollid/'+pollid});
				}else{
					jQuery.facebox({ajax:SITEROOT + '/abusereport/report/success/' + '2'});
				}
}

function viewnextpollmodule(){
// 	$('#next_poll').click(function() {
                location.reload();
//             });	
		}

function nextpoll(userid,num,cnt){
	if(parseInt(num+1)< parseInt(cnt)){
		//	$("#alt_load").html("<img src='"+SITEROOT+"/templates/default/images/loading.gif' alt='' />");		
			$.post(SITEROOT + '/ajax/nextpoll/',{userid:userid,num:num+1,cnt:cnt},function(data){ 
				$("#pollquestion").html(data);
			},'html');
	}else{
		$("#viewnextpoll").html('');
	}	
}

