﻿/*if(typeof Soda=="undefined")Soda={};if(typeof Soda.Ajax=="undefined")Soda.Ajax={};Soda.Ajax.Polls_class=function(){};Object.extend(Soda.Ajax.Polls_class.prototype,Object.extend(new AjaxPro.AjaxClass(),{GetAvailable:function(){return this.invoke("GetAvailable",{},this.GetAvailable.getArguments().slice(0));},Get:function(id){return this.invoke("Get",{"id":id},this.Get.getArguments().slice(1));},RegisterVote:function(pollID,optionID){return this.invoke("RegisterVote",{"pollID":pollID,"optionID":optionID},this.RegisterVote.getArguments().slice(2));},url:'/ajaxpro/Soda.Ajax.Polls,Soda.ashx'}));Soda.Ajax.Polls=new Soda.Ajax.Polls_class();
*/
if(typeof Soda == "undefined") Soda={};
if(typeof Soda.Ajax == "undefined") Soda.Ajax={};
Soda.Ajax.Polls_class = function() {};
Object.extend(Soda.Ajax.Polls_class.prototype, Object.extend(new AjaxPro.AjaxClass(), {
	GetAvailable: function() {
		return this.invoke("GetAvailable", {}, this.GetAvailable.getArguments().slice(0));
	},
	Get: function(id) {
		return this.invoke("Get", {"id":id}, this.Get.getArguments().slice(1));
	},
	RegisterVoteEx: function(pollID, optionID, w, prms) {
		return this.invoke("RegisterVoteEx", {"pollID":pollID, "optionID":optionID, "w":w,"prms":prms}, this.RegisterVoteEx.getArguments().slice(4));
	},
	GetResultsClassic: function(pollID) {
		return this.invoke("GetResultsClassic", {"pollID":pollID}, this.GetResultsClassic.getArguments().slice(1));
	},
	GetActualPolls: function(pollID) {
		return this.invoke("GetActualPolls", {"pollID":pollID}, this.GetActualPolls.getArguments().slice(1));
	},
	GetResults: function(pollID) {
		return this.invoke("GetResults", {"pollID":pollID}, this.GetResults.getArguments().slice(1));
	},
	RegisterVote: function(pollID, optionID) {
		return this.invoke("RegisterVote", {"pollID":pollID, "optionID":optionID}, this.RegisterVote.getArguments().slice(2));
	},
	RegisterVoteClassic: function(pollID, optionID) {
		return this.invoke("RegisterVoteClassic", {"pollID":pollID, "optionID":optionID}, this.RegisterVoteClassic.getArguments().slice(2));
	},
	GetPollsPage: function(idNav, pageNo) {
		return this.invoke("GetPollsPage", {"idNav":idNav, "pageNo":pageNo}, this.GetPollsPage.getArguments().slice(2));
	},
	url: '/ajaxpro/Soda.Ajax.Polls,Soda.ashx'
}));
Soda.Ajax.Polls = new Soda.Ajax.Polls_class();


function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else expires="";document.cookie=name+"="+value+expires+"; path=/";};function readCookie(name){var nameEQ=name+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' ')c=c.substring(1,c.length);if(c.indexOf(nameEQ)==0)return c.substring(nameEQ.length,c.length);}return null;};function LoadPoll(id){var ret=Soda.Ajax.Polls.Get(id);document.getElementById("PollBox").innerHTML=ret.value;};function SubmitVote(){var vals=document.getElementsByName("PO");var val= -1;for(var i=0;i<vals.length;i++){if(vals[i].checked){val=vals[i].value;break;}}if(val> -1){var pid=document.getElementById("CPI").value;var ret=Soda.Ajax.Polls.RegisterVote(pid,val);var t=readCookie("_vc");if(t==null||t.length==0){t=pid;}else{t=t+","+pid;}createCookie("_vc",t,1985);document.getElementById("PollBox").innerHTML=ret.value;try {if(isIE){addRoundedIECorners();}else{addRoundedCorners();}}catch(e){}}else{alert("Sélectionnez une option...");}}
function SubmitVote1(){var vals=document.getElementsByName("PO");var val= -1;for(var i=0;i<vals.length;i++){if(vals[i].checked){val=vals[i].value;break;}}if(val> -1){var pid=document.getElementById("CPI").value;var ret=Soda.Ajax.Polls.RegisterVoteClassic(pid,val,LoadResults_CB);var t=readCookie("_vc");if(t==null||t.length==0){t=pid;}else{t=t+","+pid;}createCookie("_vc",t,1985);try {if(isIE){addRoundedIECorners();}else{addRoundedCorners();}}catch(e){}}else{alert("Sélectionnez une option...");}}
function GoToPollsPage(i){CP=i; var s=Soda.Ajax.Polls.GetPollsPage(IDNav,i).value;document.getElementById("PollsList").innerHTML=s;}
function GoToPollsPageP(i){GoToPollsPage(i-1);}
function GoToPollsPageN(i){GoToPollsPage(i+1);}