var sharethis_objects = new Array();

var core = {
	writeShareThis: function(postid) {
		this.postid = postid;
		Event.observe(window, 'load', core.attachShareThis.bind(this));
	},
	attachShareThis: function() {
		var new_a;
		//new_a = new Element('a', { href: 'javascript:void(0)', title: 'Share This Post!', class:'sharePost' }).update('<span class="hidetextlink">Share This Post!</span>');
		new_a = new Element('a').update('<span class="hidetextlink">Share This Post!</span>');
		$(new_a).setAttribute('href',  'javascript:void(0)');
		$(new_a).setAttribute('title',  'Share This Post!');
		$(new_a).addClassName('sharePost');
		$('shareThis'+this.postid).update(new_a);
		sharethis_objects[this.postid].attachButton(new_a);
	}
}

var poll = {
	
	vote: function() {
		if ($$('input[name=poll]:checked').length > 0) {
		  var vote = $($$('input[name=poll]:checked')[0]);
		  var poll_id = $($$('input[name=poll_id]')[0]);
		  new Ajax.Updater('pollQuestions', '/', {
		    parameters: { vote: $F(vote), poll_id: $F(poll_id), action: 'pollvote' }
		  });
		}
	},
	
}
