//kumpulan utilities

function toggleview(id)
{  tmp_id = document.getElementById(id);

   if (tmp_id.style.display == 'none')
   {  tmp_id.style.display = '';
   }
   else
   {  tmp_id.style.display = 'none';
   }
}

function winopen(curl)
{
    var height = 0.6*screen.height; //-200-120;
    var width  = 0.7*screen.width; //-200-20;
    var posL = (screen.width - width)/2; //200;
    var posT = (screen.height - height)/2; //200;

    winatur='top='+posT+',left='+posL+'toolbar=no,location=no,directories=no,status=yes, menubar=no,copyhistory=no, width='+width+',height='+height+', scrollbars=yes, resizable=yes';
    win = window.open(curl, "newWin", winatur );
}

function pviiObjbg(obj, new_color) { //v2.1 by Project VII
   obj.style.backgroundColor=new_color
}

//20081022
function isNotNumeric(sItem)
{
  if (!check(sItem,"1234567890"))
          return "Salah: Anda harus mengisikan angka, bukan karakter lain";
  return "";
}

//20081022
function check(sInput, sCheck) {
  var chr, j;
  var bfound = false;
  var ok = true;
  for (var i = 0; i < sInput.length; i++)
  {
          chr = sInput.charAt(i);
          bfound = false;
          for (j=0; j < sCheck.length; j++)
          {
                  if (chr == sCheck.charAt(j)) bfound = true;
          }
          if (!bfound) ok = false;
  }
  return ok;
}
