function restrictNumeric( ev, elmInput ){
    ev = ev?window.event:ev;
    
    var k = ev.keyCode;
    //alert( k );
    return false;
    //return !isNaN( parseFloat( elmInput.value ) );
}

function calculatePoints(){
    var n = parseFloat( document.calculator.players.value );
    var r = parseFloat( document.calculator.rank.value );
    var b = parseFloat( document.calculator.buyIn.value );
    
    var p;
    var percent;
    
    // make sure all are positive numbers and there is no divide by zero
    if ( !( isNaN(n) || isNaN(r) || isNaN(b) ) & n >= 0 & r > 0 & b >= 0 ){
        percent = ( r / n )
        
        if ( percent > 0.2 ){
            p = 0;
        } else {
            p = 10 * ( Math.sqrt( n ) / Math.sqrt( r ) ) * ( Math.sqrt( Math.sqrt( b ) ) + 0.2 );
            p = ( Math.floor( p * 100 ) / 100 );
        }
    }
    
    document.getElementById( 'points-tip' ).style.visibility = ( p==0 )?"visible":"hidden";

    p = ( p != null )?p:"";
    percent = ( percent != null )?"&nbsp;( Top " + Math.ceil( percent * 100 ) + "% )":"";
    
    document.calculator.points.value = p;
    document.getElementById( 'percent' ).innerHTML = percent;
     
}