function "kal" and "getsign" not functioning.
function kal (ta) {
var xy;
var x1 ;
var x2;
var x3;
var x4;
if (xy==1) {x1=0; x2=1; x3=1; x4=1;}
else if (xy==2) {x1=1; x2=0; x3=1; x4=0;}
else if (xy==3) {x1=0; x2=1; x3=0; x4=1;}
else if (xy==4) {x1=1; x2=1; x3=1; x4=1;}
else if (xy==5) {x1=0; x2=0; x3=1; x4=0;}
else if (xy==6) {x1=0; x2=1; x3=1; x4=0;}
else if (xy==7) {x1=1; x2=1; x3=1; x4=0;}
else if (xy==8) {x1=1; x2=0; x3=1; x4=1;}
else if (xy==9) {x1=1; x2=1; x3=0; x4=1;}
else if (xy==10) {x1=0; x2=0; x3=1; x4=1;}
else if (xy==11) {x1=1; x2=1; x3=0; x4=0;}
else if (xy==12) {x1=0; x2=0; x3=0; x4=1;}
else if (xy==13) {x1=0; x2=1; x3=0; x4=0;}
else if (xy==14) {x1=1; x2=0; x3=0; x4=0;}
else if (xy==15) {x1=1; x2=0; x3=0; x4=1;}
else if (xy==16) {x1=0; x2=0; x3=0; x4=0;}
this.xa = x1;
this.xb = x2;
this.xc = x3;
this.xd = x4;
return this;
}
xaxa = kal(as)
w1 = xaxa.xa
xbxb =kal(bs)
w2 =xbxb.xa
xcxc =kal(cs)
w3 = xcxc.xa
xdxd = kal(ds)
w4 = xdxd.xa
function getsign(w1, w2, w3, w4) {
var sa;
var w1;
var w2;
var w3;
var w4;
if (w1==0 && w2==1 && w3==1 && w4==1) {sa = 1};
if (w1==1 && w2==0 && w3==1 && w4==0) {sa = 2};
if (w1==0 && w2==1 && w3==0 && w4==1) {sa = 3};
if (w1==1 && w2==1 && w3==1 && w4==1) {sa = 4};
if (w1==0 && w2==0 && w3==1 && w4==0) {sa = 5};
if (w1==0 && w2==1 && w3==1 && w4==0) {sa = 6};
if (w1==1 && w2==1 && w3==1 && w4==0) {sa = 7};
if (w1==1 && w2==0 && w3==1 && w4==1) {sa = 8};
if (w1==1 && w2==1 && w3==0 && w4==1) {sa = 9};
if (w1==0 && w2==0 && w3==1 && w4==1) {sa = 10};
if (w1==1 && w2==1 && w3==0 && w4==0) {sa = 11};
if (w1==0 && w2==0 && w3==0 && w4==1) {sa = 12};
if (w1==0 && w2==1 && w3==0 && w4==0) {sa = 13};
if (w1==1 && w2==0 && w3==0 && w4==0) {sa = 14};
if (w1==1 && w2==0 && w3==0 && w4==1) {sa = 15};
if (w1==0 && w2==0 && w3==0 && w4==0) {sa = 16};
return sa;
}
sign = getsign(w1, w2, w3, w4)
function kal (ta) {
var xy;
var x1 ;
var x2;
var x3;
var x4;
if (xy==1) {x1=0; x2=1; x3=1; x4=1;}
else if (xy==2) {x1=1; x2=0; x3=1; x4=0;}
else if (xy==3) {x1=0; x2=1; x3=0; x4=1;}
else if (xy==4) {x1=1; x2=1; x3=1; x4=1;}
else if (xy==5) {x1=0; x2=0; x3=1; x4=0;}
else if (xy==6) {x1=0; x2=1; x3=1; x4=0;}
else if (xy==7) {x1=1; x2=1; x3=1; x4=0;}
else if (xy==8) {x1=1; x2=0; x3=1; x4=1;}
else if (xy==9) {x1=1; x2=1; x3=0; x4=1;}
else if (xy==10) {x1=0; x2=0; x3=1; x4=1;}
else if (xy==11) {x1=1; x2=1; x3=0; x4=0;}
else if (xy==12) {x1=0; x2=0; x3=0; x4=1;}
else if (xy==13) {x1=0; x2=1; x3=0; x4=0;}
else if (xy==14) {x1=1; x2=0; x3=0; x4=0;}
else if (xy==15) {x1=1; x2=0; x3=0; x4=1;}
else if (xy==16) {x1=0; x2=0; x3=0; x4=0;}
this.xa = x1;
this.xb = x2;
this.xc = x3;
this.xd = x4;
return this;
}
xaxa = kal(as)
w1 = xaxa.xa
xbxb =kal(bs)
w2 =xbxb.xa
xcxc =kal(cs)
w3 = xcxc.xa
xdxd = kal(ds)
w4 = xdxd.xa
function getsign(w1, w2, w3, w4) {
var sa;
var w1;
var w2;
var w3;
var w4;
if (w1==0 && w2==1 && w3==1 && w4==1) {sa = 1};
if (w1==1 && w2==0 && w3==1 && w4==0) {sa = 2};
if (w1==0 && w2==1 && w3==0 && w4==1) {sa = 3};
if (w1==1 && w2==1 && w3==1 && w4==1) {sa = 4};
if (w1==0 && w2==0 && w3==1 && w4==0) {sa = 5};
if (w1==0 && w2==1 && w3==1 && w4==0) {sa = 6};
if (w1==1 && w2==1 && w3==1 && w4==0) {sa = 7};
if (w1==1 && w2==0 && w3==1 && w4==1) {sa = 8};
if (w1==1 && w2==1 && w3==0 && w4==1) {sa = 9};
if (w1==0 && w2==0 && w3==1 && w4==1) {sa = 10};
if (w1==1 && w2==1 && w3==0 && w4==0) {sa = 11};
if (w1==0 && w2==0 && w3==0 && w4==1) {sa = 12};
if (w1==0 && w2==1 && w3==0 && w4==0) {sa = 13};
if (w1==1 && w2==0 && w3==0 && w4==0) {sa = 14};
if (w1==1 && w2==0 && w3==0 && w4==1) {sa = 15};
if (w1==0 && w2==0 && w3==0 && w4==0) {sa = 16};
return sa;
}
sign = getsign(w1, w2, w3, w4)