function markcheck(field,checked,position,total) {
	fObj = $(field);
	current = fObj.value;
	if (current.length < total) {
		while (current.length < total)
			current.value += "0";
		current.value += "000"; // padding
	}
	final = "";
	for (p = 0; p<total; p++) {
		if (p != position)
			final += current.charAt(p);
		else
			final += checked ? "1" : "0";
	}
	fObj.value = final;
}

function enterModule(name,action) {
	Effect.Pulsate(name);
	document.location = action;
}
function highme(name,mode) {
	over = "#acacac";
	out = "#FFFFFF";
	if (mode)
		$(name).style.border = "1px solid "+over;
	else
		$(name).style.border = "1px solid "+out;
}
function selectall(para,filter) {
  frm = document.frmbase;
  for (var i=0;i<frm.elements.length;i++) {
    if ((!filter && frm.elements[i].id.substring(0,2) == "id") || (filter && frm.elements[i].id.indexOf(filter) != -1)) {
      if (!frm.elements[i].disabled) frm.elements[i].checked = para;
    }
  }
}
function linkme(select,module) {
	obj = $(select);
	if (obj.value == "") return;
	document.location = "edit.php?module=" + module + "&id=" + obj.value;
}

function checkposfield(campo,bgc) {
  if (!bgc || bgc=="") bgc = fieldcolor; // from common
  if (!ereg(campo.value,"^([0-9]+,[0-9]+)?$")){
    campo.style.background= invalidcolor;
    return false;
  } else {
    campo.style.background=bgc;
    return true;
  }
}



