﻿function powerPrices() {
    $(".no_optional_licences").keyup(function(){
	    no_licences = $(this).val();
	    
	    if (no_licences > 0) {
	        $(this).val(parseInt(no_licences));
	        $("#equation").addClass('visible');
	        $("#the_nom_of_licences").html(parseInt(no_licences));
	        total = 99 + parseInt(no_licences) * 65;
	        $("#the_total_sum").html(total);
	    } else {
	        $("#equation").removeClass('visible');
	        $(this).val(0);
	    }
	}).focus(function(){
	   $(this).val(''); 
	});
}

$(document).ready(function() {
    powerPrices();
});