Function to convert decimal to binary
function decimalToBinaryNumber ( x , n ) { var binaryNumber = Array ( x ) ; var i = 0 ; while ( x > 0 ) { binaryNumber [ i ] = x % 2 ; x = parseInt ( x / 2 ) ; i ++ ; }