﻿function FirejQueryCalculator()
{

    $('#calc-numinputs input:text').each( 
            function() {$(this).blur(function() {
				$(this).formatCurrency({ colorize: true, symbol: ' ',
		            positiveFormat: '%n', negativeFormat: '-%n %s', roundToDecimalPlace: -1, eventOnDecimalsEntered: true, decimalSymbol: ',',
		            digitGroupSymbol: ' ',
		            groupDigits: true });
			    })
			            .keyup(function(e) {
				            var e = window.event || e;
				            var keyUnicode = e.charCode || e.keyCode;
				            if (e !== undefined) {
					            switch (keyUnicode) {
						            case 27: this.value = ''; break; // Esc
						            case 37: break; // cursor left
						            case 38: break; // cursor up
						            case 39: break; // cursor right
						            case 40: break; // cursor down
						            case 78: break; // N (Opera 9.63+ maps the "." from the number key section to the "N" key too!) (See: http://unixpapa.com/js/key.html search for ". Del")
						            case 110: break; // . number block (Opera 9.63+ maps the "." from the number block to the "N" key (78) !!!)
						            case 190: break; // .
						            default: $(this).formatCurrency({ colorize: true, symbol: ' ',
		                                                positiveFormat: '%n', negativeFormat: '-%n %s', roundToDecimalPlace: -1, eventOnDecimalsEntered: true, decimalSymbol: ',',
		                                                digitGroupSymbol: ' ',
		                                                groupDigits: true });
					            }
				            }
				        }) 
		    });

			
    $('#seznamZajem li').each(function() {
        var chb = $(this).find("input:checkbox").get(0);
        $(this).toggleClass("selected", chb.checked);
    }); 
    
}


