// // bandwidth_hour   bandwidth_minute   bandwidth_bitrate
var bandwidth = { 
	calc: function () {
		// alert('test'); 		// var bw_length = $('#bandwith_length').value, bw_time = $('#bandwith_length').value;
		// bandwidth_results
		var bw_minute 	= parseInt($('#bandwidth_minute').val()), 
			bw_hour 	=  parseInt($('#bandwidth_hour').val()), 
			bw_bitr 	= parseInt($('#bandwidth_bitrate').val());
			
			viewers = $('#bandwidth_viewers').val();
			viewers = viewers.replace(/\D/g,'');

			
		var total_peruser = ((bw_hour * 60 * 60) + (bw_minute * 60)) * (bw_bitr / 8);			
		var total_band = Math.round((parseInt(viewers) * total_peruser) * 100)/100;
		var total_band = Math.round((total_band / 1024)*10)/10;
	 	if (total_band > 1024) { 
	 		var gig = Math.round((total_band / 1024) * 100)/100;
	 		$('#bandwidth_results').html(gig + ' GB');
	 	} else {
			$('#bandwidth_results').html(total_band + ' MB');
		}	
	}
} 
