<!--
	// This function makes sure that the user selected a voting option.
	function OneOptionChecked()
	{
		var i;
		
		// Let's iterate through our voting options, returning true if
		// we come across a checked radio box
		for (i = 0; i < document.poll_form.Voting.length; i++)
			if (document.poll_form.Voting[i].checked) return true;
		
		// If we reach this point, then the user didn't check any voting options
		alert("Please make a selection \nbefore you submit your vote!");
		return false;
	}


//Update the selected option counter for the current question
//only when there is actually something that is selected and
//the poll_form is submitted   
function updateQPoll() {
				 
}

function cookie_setup() {
	var cookie_question = GetCookie('question');
	var current_question = document.poll_form.cookie.value;
	var next_question = document.poll_form.next_question.value;
	if ( OneOptionChecked() == false )
		return false;
	
	if (cookie_question == current_question) 
	{
		if (next_question != "")
			alert('Thanks, You have already voted!\n Our next vote will start on \n' + next_question);
		else
			alert('Sorry, you have voted on this question before!');

		return false;
	}
	else {
			for (i = 0; i < document.poll_form.Voting.length; i++)
					if (document.poll_form.Voting[i].checked) 
						 document.poll_form.chosenOption.value = document.poll_form.Voting[i].value;

	    pathname = location.pathname;
	    myDomain = 	pathname.substring(0,pathname.lastIndexOf('/')) +'/';
	    // set expiry date to 1 year from now.
	    var largeExpDate = new Date ();
	    largeExpDate.setTime(largeExpDate.getTime() + (365 * 24 * 	3600 * 1000));
	    	SetCookie('question',current_question,largeExpDate,myDomain);
		return true;
	}
//	return true;

}

function getCookieVal (offset) {
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1)
      endstr = document.cookie.length;
   return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
        var arg = name + "=";
        var alen = arg.length;
        var clen = document.cookie.length;
        var i = 0;
        while (i < clen) {
                var j = i + alen;
                if (document.cookie.substring(i, j) == arg)
                        return getCookieVal (j);
                i = document.cookie.indexOf(" ", i) + 1;
                        if (i == 0)
                                break;
                }
   return null;
}
function SetCookie (name, value) {
        var argv = SetCookie.arguments;
        var argc = SetCookie.arguments.length;
        var expires = (argc > 2) ? argv[2] : null;
        var path = (argc > 3) ? argv[3] : null;
        var domain = (argc > 4) ? argv[4] : null;
        var secure = (argc > 5) ? argv[5] : false;
        document.cookie = name + "=" + escape (value) +
                ((expires == null) ? "" : ("; expires=" +
expires.toGMTString())) +
                ((path == null) ? "" : ("; path=" + path)) +
                ((domain == null) ? "" : ("; domain=" + domain)) +
                ((secure == true) ? "; secure" : "");
}


//-->