
function bool2int(x)
{
 if (mytype(x)=='undefined') return 0;
 if (x) return 1; else return 0;
}


