jQuery.fn.buildBSCalendar=function(){
	return this.each(function(){    
			$(this).after('<img src="lib/js/calendar/images/b_calendar.png" name="'+"bsDate_"+$(this).attr('id')+'" width="16" height="16" border="0" id="'+"bsDate_"+$(this).attr('id')+'" title="Date selector" />');
			if($(this).attr('sbDateFormat'))
			{
				myDateFormat=$(this).attr('sbDateFormat');
			}
			else
			{
				myDateFormat="%B %e, %Y";
			}
								    Calendar.setup({
								        inputField     :    $(this).attr('id'),
								        ifFormat       :    myDateFormat,  
										button         :    "bsDate_"+$(this).attr('id'),								        
										align          :    "Tl",
								        singleClick    :    true
								    });


	});
}

var wasInitVotes;
var SBVotesOutTimeOut;
jQuery.fn.buildVotes=function()
{
	$('#SBuserVotes').width(0);
 $('#SBemptyVotes').mouseout( function(e){
 clearTimeout(SBVotesOutTimeOut);
 SBVotesOutTimeOut=setTimeout("$('#SBuserVotes').width(1)",500);
});
   $('#SBemptyVotes').mousemove(function(e){
    clearTimeout(SBVotesOutTimeOut);
	myW=Math.ceil((e.pageX -$(this).offset().left)/ $(this).width() *5)

	$('#SBvotesNote').val(myW);
	$('#SBuserVotes').width(myW*30);
//      $('#status').html(myW+', '+ e.pageY);
   }); 
 $('#SBemptyVotes').click( function() { 
	$('#SBcastVoteForm').submit()
	} );

}









