/******** 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/ ********/
var is_ff = false; if( navigator.userAgent.indexOf('firefox') != -1 || navigator.userAgent.indexOf('Firefox') != -1 || navigator.userAgent.indexOf('FireFox') != -1 ) { is_ff = true; } 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); } if( is_ff ) { $('#in_house_hourly_weekly').hide().animate({ opacity: '1' }, 400).html('= $' + add_comma(rate * 40) + ' weekly').slideDown('slow'); $('#in_house_hourly_monthly').hide().animate({ opacity: '1' }, 400).html('= $' + add_comma(rate * 40 * 4) + ' monthly').slideDown('slow'); $('#in_house_hourly_yearly').hide().animate({ opacity: '1' }, 400).html('= $' + add_comma(rate * 40 * 4 * 12) + '').slideDown('slow'); $('#in_house_hourly_annually').hide().animate({ opacity: '1' }, 400).html('= $' + add_comma((rate * 40 * 4 * 12 * .35) + (rate * 40 * 4 * 12)) + '+ annually').slideDown('slow'); } else { $('#in_house_hourly_weekly').animate({ width: 'hide' }, 'fast', 'linear', function() { $('#in_house_hourly_weekly').html('= $' + add_comma(rate * 40) + ' weekly').animate({ width: 'show' }, 'slow'); }); $('#in_house_hourly_monthly').animate({ width: 'hide' }, 'fast', 'linear', function() { $('#in_house_hourly_monthly').html('= $' + add_comma(rate * 40 * 4) + ' monthly').animate({ width: 'show' }, 'slow'); }); $('#in_house_hourly_yearly').animate({ width: 'hide' }, 'fast', 'linear', function() { $('#in_house_hourly_yearly').html('= $' + add_comma(rate * 40 * 4 * 12) + '').animate({ width: 'show' }, 'slow'); }); $('#in_house_hourly_annually').animate({ width: 'hide' }, 'fast', 'linear', function() { $('#in_house_hourly_annually').html('= $' + add_comma((rate * 40 * 4 * 12 * .35) + (rate * 40 * 4 * 12)) + '+ annually').animate({ width: 'show' }, 'slow'); }); } 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); } if( is_ff ) { $('#va_rate_hours_weekly').hide().animate({ opacity: '1' }, 400).html('= $' + add_comma(widget_engine_va_hourly_rate * hours) + ' weekly').slideDown('slow'); $('#va_rate_hours_monthly').hide().animate({ opacity: '1' }, 400).html('= $' + add_comma(widget_engine_va_hourly_rate * hours * 4) + ' monthly').slideDown('slow'); $('#va_rate_hours_yearly').hide().animate({ opacity: '1' }, 400).html('= $' + add_comma(widget_engine_va_hourly_rate * hours * 4 * 12) + ' annually').slideDown('slow'); } else { $('#va_rate_hours_weekly').animate({ width: 'hide' }, 'fast', 'linear', function() { $('#va_rate_hours_weekly').html('= $' + add_comma(widget_engine_va_hourly_rate * hours) + ' weekly').animate({ width: 'show' }, 'slow'); }); $('#va_rate_hours_monthly').animate({ width: 'hide' }, 'fast', 'linear', function() { $('#va_rate_hours_monthly').html('= $' + add_comma(widget_engine_va_hourly_rate * hours * 4) + ' monthly').animate({ width: 'show' }, 'slow'); }); $('#va_rate_hours_yearly').animate({ width: 'hide' }, 'fast', 'linear', function() { $('#va_rate_hours_yearly').html('= $' + add_comma(widget_engine_va_hourly_rate * hours * 4 * 12) + ' annually').animate({ width: 'show' }, 'slow'); }); } 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 ******************************************************************************/