/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
$(function() {
    var flaga1, flaga2, flaga3 , flaga4, flaga5 , flaga6 , flaga7, flaga8, flaga9 , flaga10, flaga11 , flaga12 , flaga13 , flaga14;
   
    
    $('#form input').keyup(function(){
        
         if($('#form input[name=2]').val() == 4) {
             flaga2 = 'ok';
         }else{
             flaga2 = 0;
         }
         if($('#form input[name=4]').val() == 8) {
            flaga4 = 'ok';
         }else{
            flaga4 = 0;
         }
         if($('#form input[name=6]').val() == 12) {
             flaga6 = 'ok';
         }else{
             flaga6 = 0;
         }
         if($('#form input[name=8]').val() == 1) {
             flaga8 = 'ok';
         }else{
             flaga8 = 0;
         }
         if($('#form input[name=10]').val() == 5) {
             flaga10 = 'ok';
         }else{
             flaga10 = 0;
         }
         if($('#form input[name=12]').val() == 9) {
             flaga12 = 'ok';
         }else{
             flaga12 = 0;
         }
         if($('#form input[name=14]').val() == 13) {
             flaga14 = 'ok';
         }else{
             flaga14 = 0;
         }
         if($('#form input[name=1]').val() == 2) {
             flaga1 = 'ok';
         }else{
             flaga1 = 0;
         }
         if($('#form input[name=3]').val() == 6) {
            flaga3 = 'ok';
         }else{
            flaga3 = 0;
         }
         if($('#form input[name=5]').val() == 10) {
             flaga5 = 'ok';
         }else{
             flaga5 = 0;
         }
         if($('#form input[name=7]').val() == 14) {
             flaga7 = 'ok';
         }else{
             flaga7 = 0;
         }
         if($('#form input[name=9]').val() == 3) {
             flaga9 = 'ok';
         }else{
             flaga9 = 0;
         }
         if($('#form input[name=11]').val() == 7) {
             flaga11 = 'ok';
         }else{
             flaga11 = 0;
         }
         if($('#form input[name=13]').val() == 11) {
             flaga13 = 'ok';
         }else{
             flaga13 = 0;
         }
         if(flaga1==='ok' && flaga2==='ok' && flaga3==='ok' && flaga4==='ok' && flaga5==='ok' && flaga6==='ok' && flaga7==='ok' && flaga8==='ok' && flaga9==='ok' && flaga10==='ok' && flaga11==='ok' && flaga12==='ok' && flaga13==='ok' && flaga14==='ok' ){
             alert("BRAWO");
         }else{
             console.log(flaga1, flaga2, flaga3 , flaga4, flaga5 , flaga6 , flaga7, flaga8, flaga9 , flaga10, flaga11 , flaga12 , flaga13 , flaga14);
         }
    });
});

