function AllDigits(myString)
{
  if ((myString == null) || (myString == "")) return false;

  var regex = /^(P)?([0-9]|\.)*$/i;
  var match = myString.match(regex);

	return(match != null);
}

function AllLetters(myString)
{
  if ((myString == null) || (myString == "")) return false;

  var regex = /^([a-z]|[0-9]|\s|\-|\'\")*$/i;
  var match = myString.match(regex);

	return(match != null);
}

function OpenWindowEx(Adocument, AName, Awidth, Aheigth)
{
  if (screen.height > 600)
    popupwindow = open (Adocument, AName, "toolbar=no,location=0,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + Awidth + ",height=" + Aheigth)
  else
    popupwindow = open (Adocument, AName, "toolbar=no,location=0,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + Awidth + ",height=500");
  popupwindow.focus();
}

function Currency(valAmount)
{
  valAmount2=Math.round(valAmount*100)/100;
  valAmount2=valAmount2.toString().replace(/,/,'.');
  valAmount=valAmount2;
  valAmount=valAmount.toString();
  arrResult=valAmount.split('.');
  if (arrResult.length==1) return valAmount+',00';
  if (arrResult[1]<10) arrResult[1]=arrResult[1]+'0';
  if (arrResult[1].length>2) arrResult[1]=arrResult[1].substr(0,2);
  return arrResult[0]+','+arrResult[1];
}

function getLeft(oObj)
{
  var iLeft = 0;
  iLeft = oObj.offsetLeft;
  if(oObj.parentElement) iLeft+=getLeft(oObj.parentElement);
  return iLeft;
}

function Loader()
{
  var imgname = 'btn_bedrijf|btn_zorgaanbieder|btn_verzekerde';
  var normalstate = '/zenz/images/btn_bedrijf.gif|/zenz/images/btn_zorgaanbieder.gif|/zenz/images/btn_verzekerde.gif';
  var mouseoverstate = '/zenz/images/btn_bedrijf_mo.gif|/zenz/images/btn_zorgaanbieder_mo.gif|/zenz/images/btn_verzekerde_mo.gif';
  var clickedstate=mouseoverstate;
  iPreload(imgname, normalstate, mouseoverstate, clickedstate);
}

function isEmail(sValue)
{
  return (sValue.indexOf("@")>0 && sValue.lastIndexOf(".") > (sValue.indexOf("@")+2) && sValue.length > (sValue.lastIndexOf(".")+2));
}

function OpenWindow(strContent)
{
  sAdd = (OpenWindow.arguments[1]) ? ','+OpenWindow.arguments[1]:',width=550,height=450'
  var newwindow = null;
  newwindow = open('Popup.php?content='+strContent, "newWindow", "toolbar=no,location=0,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes"+sAdd);
  newwindow.focus();
}

function OpenZoekWindow()
{
  sAdd = ',width=420,height=200';
  var newwindow = null;
  newwindow = open('Popup_zoek.php', "newWindow", "toolbar=no,location=0,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes"+sAdd);
  newwindow.focus();
}
