
	var strID = "slowingdown";
	var strQuestion = "Is this new law slowing drivers down?";
	var strValue = 1;
	var strPoll = null;


	function displayPoll(  strPollName ) {
		// eraseCookie( strID );
		if( readCookie( strID ) == null ) {
			displayPollForm( strID );
		} else {
			displayResults( false );
		}
	}

	function displayPollForm(  strPollName ) {

		var strHTML = '<p class="question">Is this new law slowing drivers down?</p>';
		strHTML += '<p>';
		
		strHTML += '<input type="radio" value="Yes" onclick="vote( \'Yes\' );" name="vote" />Yes, drivers are now driving slower now.<br />';
		
		strHTML += '<input type="radio" value="No" onclick="vote( \'No\' );" name="vote" />No, drivers go as fast as ever.';
		
		strHTML += '<br /><small>Vote to see results</small>';
		strHTML += '</p>';
		document.write( strHTML );
	}

	function vote( strValue ) {
		createCookie( strID, strValue, 500 );
		displayResults( true, strValue );
	}

	function displayResults( bVote, strValue ) {
		var poll = document.getElementById( 'poll' );
		var strHTML = '<p class="question">Is this new law slowing drivers down?</p>';
		// var strValues = 't:467,4309';
		var strValues = 's:H9';
		
		var strLabels = 'Yes-10%|No-90%';
		strHTML += '<img src="http://chart.apis.google.com/chart?cht=p&amp;chd=' + strValues + '&amp;chs=210x100&amp;chl=' + strLabels + '&amp;chco=6bbf3d&amp;/&gt;" />';

		strHTML += '<br />';
		strHTML += '<small>Based on 4776 responses.</small>';
		if( bVote ) {
			// Contruct a dynamic image
			// var strValue = document.getElementById( "vote" ).value;
			var strImage = unescape("%3Cimg class='vote' src='vote.asp?id=slowingdown%26value=" ) + strValue + unescape( "'/%3E" );
			strHTML += strImage;
		}
		poll.innerHTML = strHTML;
	}


