function stripBorder_1(object) { object.each(function() { if( parseInt(jQuery(this).width() ) > 0) { jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css("border-left-width")) - parseInt(jQuery(this).css("border-right-width")) ); } else { jQuery(this).css("border-left-width", '0px'); jQuery(this).css("border-right-width", '0px'); } }); } function stripPadding_1(object) { object.each(function() { jQuery(this).width( parseInt( jQuery(this).width() ) - parseInt(jQuery(this).css("padding-left")) - parseInt(jQuery(this).css("padding-left")) ); }); } function strip_results_1() { stripPadding_1( jQuery("#yop-poll-container-1 .yop_poll_li_result-1") ); stripBorder_1( jQuery("#yop-poll-container-1 .yop-poll-result-bar-1")); } jQuery(document).ready(function(e) { if(typeof window.strip_results_1 == 'function') strip_results_1(); if(typeof window.tabulate_answers_1 == 'function') tabulate_answers_1(); if(typeof window.tabulate_results_1 == 'function') tabulate_results_1(); }); function equalWidth_1(obj, cols, findWidest ) { findWidest = typeof findWidest !== 'undefined' ? findWidest : false; if ( findWidest ) { obj.each(function() { var thisWidth = jQuery(this).width(); width = parseInt(thisWidth / cols); jQuery(this).width(width); jQuery(this).css('float', 'left'); }); } else { var widest = 0; obj.each(function() { var thisWidth = jQuery(this).width(); if(thisWidth > widest) { widest = thisWidth; } }); width = parseInt( widest / cols); obj.width(width); obj.css('float', 'left'); } } function tabulate_answers_1() { equalWidth_1( jQuery("#yop-poll-container-1 .yop-poll-li-answer-1"), 1 ); //equalWidth_1( jQuery("#yop-poll-container-1 .yop-poll-li-answer-1 .yop-poll-results-bar-1 div "), 1, true ); } function tabulate_results_1() { equalWidth_1( jQuery("#yop-poll-container-1 .yop-poll-li-result-1"), 1 ); //equalWidth_1( jQuery("#yop-poll-container-1 .yop-poll-li-result-1 .yop-poll-results-bar-1 div "), 1, true ); }