function OpenWindow(pURL, pWidth, pHeight)
{
  var win = window.open(pURL, 'win', 'dependent,width=' + pWidth + ',height=' + pHeight);
}

function OpenScrollWindow(pURL, pWidth, pHeight)
{
  var win = window.open(pURL, 'scrollwin', 'dependent,width=' + pWidth + ',height=' + pHeight + ',scrollbars=1');
}

function OpenPicture(pPicture, pWidth, pHeight)
{
  OpenWindow('/openpicture.asp?picture=' + pPicture, (parseInt(pWidth) + 20), (parseInt(pHeight) + 45));
}

function MailTo(pUsername, pDomain)
{
  var strLink = 'mailto:' + pUsername + '@' + pDomain;
  window.open(strLink);
}

function ShowRow(pID)
{
  var myRow = document.all(pID);
  if (myRow)
  {    
    myRow.style.position = "static";
    myRow.style.visibility = "visible";
  }
}

function HideRow(pID)
{
  var myRow = document.all(pID);
  if (myRow)
  {    
    myRow.style.position = "absolute";
    myRow.style.left = "-1000";
    myRow.style.top = "-1000";
    myRow.style.visibility = "hidden";    
  }
}

function ShowHideBlock(pID)
{
  var e = document.getElementById('boekText');
	if (e) {
	  if (e.style.display == 'none')
		  e.style.display = 'block'
		else
		  e.style.display = 'none';
	}
}

function ContainsOnly(chars) {
	var ok=true
 for(var i=0;i<this.length;i++) {
  ok=false;
   for(var j=0;j<chars.length;j++) {
     if(this.charAt(i)==chars.charAt(j))
    ok=true;
  }
  if(!ok)
   return ok;
  }
  return ok;
}
String.prototype.ContainsOnly=ContainsOnly;

function checkValidEmail(pValue)
{
	var x = pValue;
	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
	if (filter.test(x)) return true;
	else return false;
}

function Validate_Herkomst(fm)
{
  var b = false, t;

  for (var i=0; i < fm.elements.length; i++)
  {
    if (fm.elements[i].name == 'adres_ws')
    {
      if (fm.elements[i].checked)
      {
        if (fm.elements[i].value.substring(0, 7) == 'anders_')
        {
          t = fm.elements[i].value;
          t = t.replace(/_/gi, '_text_');
          if (eval('fm.' + t).value != '')
            b = true;
        }
        else
          b = true;
      }
    }
  }

  return b;
}