/******** Sale, Claim or Modifications to this software is strictly prohibited ******************************************************************************/
/******** Virtual Assistant Forums - Widget - Calculator - JavaScript Engine - This Software is Copyrighted - http://www.virtualassistantforums.com/ ********/
(function($) { $.fn.customFadeIn = function(speed, callback) { $(this).fadeIn(speed, function() { if(!$.support.opacity) $(this).get(0).style.removeAttribute('filter'); if(callback != undefined) callback(); }); }; $.fn.customFadeOut = function(speed, callback) { $(this).fadeOut(speed, function() { if(!$.support.opacity) $(this).get(0).style.removeAttribute('filter'); if(callback != undefined) callback(); }); }; $.fn.customFadeTo = function(speed,to,callback) { return this.animate({opacity: to}, speed, function() { if (to == 1 && jQuery.browser.msie) this.style.removeAttribute('filter'); if (jQuery.isFunction(callback)) callback(); }); }; })(jQuery); function add_comma(number) { number = '' + number; if (number.length > 3) { var mod = number.length % 3; var output = (mod > 0 ? (number.substring(0,mod)) : ''); for (i=0 ; i < Math.floor(number.length / 3); i++) { if ((mod == 0) && (i == 0)) output += number.substring(mod+ 3 * i, mod + 3 * i + 3); else output+= ',' + number.substring(mod + 3 * i, mod + 3 * i + 3); } return (output); } else return number; } var minimum_rate = 7; var maximum_rate = 99; $(document).ready(function() { $('#in-house').submit( function() { var rate = $('#in_house_hourly_rate').val(); if( parseFloat(rate) != rate ) { rate = minimum_rate; $('#in_house_hourly_rate').val(minimum_rate); } if( rate < minimum_rate ) { rate = minimum_rate; $('#in_house_hourly_rate').val(minimum_rate); } if( rate > maximum_rate ) { rate = maximum_rate; $('#in_house_hourly_rate').val(maximum_rate); } $('#in_house_hourly_weekly').fadeOut(200, function() { $(this).html('= $' + add_comma(rate * widget_engine_work_hours_per_week) + ' ' + phrase_weekly + '').fadeIn(200); }); $('#in_house_hourly_monthly').fadeOut(200, function() { $(this).html('= $' + add_comma(rate * widget_engine_work_hours_per_week * 4) + ' ' + phrase_monthly + '').fadeIn(200); }); $('#in_house_hourly_yearly').fadeOut(200, function() { $(this).html('= $' + add_comma(rate * widget_engine_work_hours_per_week * 4 * 12) + '').fadeIn(200); }); $('#in_house_hourly_annually').fadeOut(200, function() { $(this).html('= $' + add_comma((rate * widget_engine_work_hours_per_week * 4 * 12 * widget_engine_tax_rate) + (rate * widget_engine_work_hours_per_week * 4 * 12)) + '+ ' + phrase_annually + '').fadeIn(200); }); return false; }); }); var minimum_hours = 1; var maximum_hours = 40; $(document).ready(function() { $('#va-rate').submit( function() { var hours = $('#va_rate_hours').val(); if( parseFloat(hours) != hours ) { hours = minimum_hours; $('#va_rate_hours').val(minimum_hours); } if( hours < minimum_hours ) { hours = minimum_hours; $('#va_rate_hours').val(minimum_hours); } if( hours > maximum_hours ) { hours = maximum_hours; $('#va_rate_hours').val(maximum_hours); } $('#va_rate_hours_weekly').fadeOut(200, function() { $(this).html('= $' + add_comma(widget_engine_va_hourly_rate * hours) + ' ' + phrase_weekly + '').fadeIn(200); }); $('#va_rate_hours_monthly').fadeOut(200, function() { $(this).html('= $' + add_comma(widget_engine_va_hourly_rate * hours * 4) + ' ' + phrase_monthly + '').fadeIn(200); }); $('#va_rate_hours_yearly').fadeOut(200, function() { $(this).html('= $' + add_comma(widget_engine_va_hourly_rate * hours * 4 * 12) + ' ' + phrase_annually + '').fadeIn(200); }); return false; }); });
/******** Virtual Assistant Forums - Widget - Calculator - JavaScript Engine - This Software is Copyrighted - http://www.virtualassistantforums.com/ ********/
/******** Sale, Claim or Modifications to this software is strictly prohibited ******************************************************************************/