function cvgrecord(id) {
  id=encodeid(decodeid(id));
  id=id.slice(2,-10)-0;
  return ((id==900)||(id==901));
}

var ScreensectionLijst = '0=Gebruik|1=Inrichting|2=Ondersteuning';

var LicencecodeLijst   = '0=|100=CVG|110=BezetFax|111=MijnAccommodatie-Basis|113=MijnAccommodatie-Pro';
var VatclassLijst      = '0=onbekend|1=NL|2=ICT|3=niet-ICT';
var IsactiveLijst      = '0=niet|1=actief';
var IsexvatLijst       = '0=incl.|1=excl.';
var IsnewLijst         = '0=|1=[nieuw]';
var PropertykindLijst  = '3=aanvinkbox (ja/nee)|1=1-regelige tekst|2=getal|4=selectiebox (lijst)|0=tekstveld|11=meertalige 1-regelige tekst|14=meertalige selectiebox (lijst)|10=meertalig tekstveld';
var PrintstatusLijst   = '0=niet geprint|1=na printen, voor email|2=na printen en na email';

var HoursLijst               = '0=0|1=1|2=2|3=3|4=4|5=5|6=6|7=7|8=8|9=9|10=10|11=11|12=12|13=13|14=14|15=15|16=16|17=17|18=18|19=19|20=20|21=21|22=22|23=23';
var PropertystatusLijst      = '0=<font color="#ff0000">in bewerking</font>|1=eigenaar accoord|2=definitief/gefiatteerd|3=gepubliceerd';
var OwnerPropertystatusLijst = '0=in bewerking|1=eigenaar accoord';
var DevelopLijst          = '0=nee|1=<font color="#ff0000"><b>develop</b></font>';
var PicturefiletypeLijst  = '=onbekend/geen|image/jpeg=JPG|image/png=PNG|image/gif=GIF';
var InvoicegroupLijst     = '0=vooraf (bij reserveren)|1=achteraf (bij afrekening)';
var InvoicegroupcodeLijst = '0=V|1=A';
var ExvatLijst            = '0=incl. BTW|1=excl. BTW';
var ReplyownerLijst       = '0=(nog) geen antwoord|1=nee|2=ja';
var BookkeepstatusLijst   = '0=in bewerking|1=gereed voor export|2=geexporteerd';
var OverdueLijst          = '0=|1=<font color="#ff0000"><b>overtijd</b></font>';
var PaytypeLijst          = '0=onbekend|1=acceptgiro|2=automatische incasso';
var PaymethodLijst        = '0=onbekend|1=kontant/kas|2=PIN-betaling|3=creditcard|4=bankoverschrijving|5=acceptgiro|6=automatische incasso|9=anders';
//oud:
//var ProductCountkindLijst = '0=vrij op te geven|1=eenmalig|2=aantal nachten|3=aantal dagen|'+
//                            '4=aantal personen (ontvangen)|5=aantal personen (geschat)|6=aantal personen (toeristenbelasting)|'+
//                            '8=borg|'+
//                            '9=terugbetaling borg|'+
//                            '42=per persoon per nacht (ontvangen)|43=per persoon per dag (ontvangen)|'+
//                            '52=per persoon per nacht (geschat)|53=per persoon per dag (geschat)|'+
//                            '62=toeristenbelasting';
var ProductCountkindLijst = '0=vrij op te geven|1=eenmalig|2=aantal nachten|3=aantal dagen|7=aantal weken|'+
                            '9=aantal uren|'+
                            '10=eindwaarde-beginwaarde|'+
                            '11=aantal personen (ontvangen)|12=aantal personen (geschat)|17=aantal personen (minimaal)|13=aantal personen (toeristenbelasting)|14=aantal volwassenen|15=aantal kinderen|16=aantal babys|'+
                            '21=aantal huisdieren|'+
                            '91=borg|92=terugbetaling borg|'+
                            '112=per persoon per nacht (ontvangen)|113=per persoon per dag (ontvangen)|117=per persoon per week (ontvangen)|'+
                            '122=per persoon per nacht (geschat)|123=per persoon per dag (geschat)|127=per persoon per week (geschat)|'+
                            '172=per persoon per nacht (minimaal)|173=per persoon per dag (minimaal)|177=per persoon per week (minimaal)|'+
                            '132=toeristenbelasting|'+
                            '142=per volwassene per nacht|143=per volwassene per dag|147=per volwassene per week|'+
                            '152=per kind per nacht|153=per kind per dag|157=per kind per week|'+
                            '162=per baby per nacht|163=per baby per dag|167=per baby per week|'+
                            '212=per huisdier per nacht|213=per huisdier per dag|217=per huisdier per week';

var NotekindLijst      = '0=Algemene notitie|1=Telefoon-notitie|2=Boeking-notitie|3=Interne notitie|4=Dag-notitie';
var NotekindcolorLijst = '0=#ffff77|1=#77ffff|2=#77ff77|3=#aaaaaa|4=#ffccaa';

function notekindname(kind) {
  return veldlijstWaarde(NotekindLijst,kind);
}

function notekindcolor(kind) {
  return veldlijstWaarde(NotekindcolorLijst,kind);
}

var licence_owneridcode  = 0;
var licence_licencecode  = 0;
var licence_businessname = '';

function getlicence(hasdc) {
  var valid=false;
  licence_owneridcode=0;
  licence_licencecode=0;
  licence_businessname='';

  if (hasdc) {
    var xmlHttp_getlicence=GetXmlHttpObject();
    if (xmlHttp_getlicence==null) {
      alert ("Browser does not support HTTP Request");
      return s;
    }
    var url="mijnaccommodatie_getlicence.php";
    url+="?owner="+common_owneridcode;
    url+="&path="+common_path;
    url+="&seed="+Math.random();
//getid('txt').innerHTML+='<br>{'+url+'}';
    xmlHttp_getlicence.open("GET",url,false);
    xmlHttp_getlicence.send(null);
    if (xmlHttp_getlicence.status==200) {
      var s=xmlHttp_getlicence.responseText;
//getid('txt').innerHTML+='<br>'+s;
      if (s!='') {
        var ar=s.split('|');
        //if (ar[0]!=900) 
        {
          licence_owneridcode  = ar[0];
          licence_licencecode  = ar[1];
          licence_businessname = ar[2];
          valid=true;
        }
      }
    }
  }
  return valid;
}

function bookcolor(kind) {
  return Kind.color(kind);
}

/*
function getcountrylijst() {
  return gettablelistex('country','countryid','name','','displayorder,name');
}
*/

function getvisiblegrouplijst() {
  return gettablelistex('visiblegroup','visiblegroupid','name','','displayorder,name');
}

function getproductclasslijst() {
  return gettablelistex('productclass','productclassid','name','','displayorder,name');
}

function getproductgrouplijst() {
  return gettablelistex('productgroup','productgroupid','name','','displayorder,name');
}

function getpropertyclasslijst() {
  return gettablelistex('propertyclass','propertyclassid','name','','displayorder,name');
}

function getpropertygrouplijst() {
  return gettablelistex('propertygroup','propertygroupid','name','','displayorder,name');
}

/*
function getpropertylijst() {
  return gettablelistex('property','propertyid','name','','displayorder,name');
}
*/

function getbrandlijst() {
  return gettablelistex('brand','brandid','name','','name');
}

/*
function getproductlijst() {
  return gettablelistex('product','productid','name','','displayorder,name');
}
*/

function gethousegrouplijst() {
  return gettablelistex('housegroup','housegroupid','name','','displayorder,name');
}

function gethousecodelijst() {
  return gettablelistex('house','houseid','accocode','','accocode');
}

function gethouselijst() {
  return gettablelistex('house','houseid','acconame','','acconame');
}

function getledgercodegrouplijst() {
  return gettablelistex('ledgercodegroup','ledgercodegroupid','name','','displayorder,name');
}

function getcustomergrouplijst() {
  return gettablelistex('customergroup','customergroupid','name','','displayorder,name');
}

function getmediumgrouplijst() {
  return gettablelistex('mediumgroup','mediumgroupid','name','','displayorder,name');
}

function getgroupkindgrouplijst() {
  return gettablelistex('groupkindgroup','groupkindgroupid','name','','displayorder,name');
}

function mijnaccommodatie_getpagemenulijst(code) {
  if (code==null) code=0; //1=met code
  var s = '';
  var xmlHttp_getcountrylijst=GetXmlHttpObject();
  if (xmlHttp_getcountrylijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getpagemenulijst.php";
  url+="?cd="+code;
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid("txt").innerHTML+="<br>{"+url+"}";
  xmlHttp_getcountrylijst.open("GET",url,false);
  xmlHttp_getcountrylijst.send(null);
  if (xmlHttp_getcountrylijst.status==200) {
    s=xmlHttp_getcountrylijst.responseText;
    s=decode_special(s);
//getid("txt").innerHTML+="<br>"+s;
  }
  return s;
}

function language_getlijst() {
  var s = '';
  var xmlHttp_getlanguagelijst=GetXmlHttpObject();
  if (xmlHttp_getlanguagelijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_language_getlijst.php";
  url+="?owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
  xmlHttp_getlanguagelijst.open("GET",url,false);
  xmlHttp_getlanguagelijst.send(null);
  if (xmlHttp_getlanguagelijst.status==200) s=xmlHttp_getlanguagelijst.responseText;
  return s;
}

function getlanguagelijst() {
  var s = '';
  var xmlHttp_getlanguagelijst=GetXmlHttpObject();
  if (xmlHttp_getlanguagelijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getlanguagelijst.php";
  url+="?owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
  xmlHttp_getlanguagelijst.open("GET",url,false);
  xmlHttp_getlanguagelijst.send(null);
  if (xmlHttp_getlanguagelijst.status==200) s=xmlHttp_getlanguagelijst.responseText;
  return s;
}

function getcountrylijst(visible) {
  if (visible==null) visible=1; //1=alleen zichtbaar
  var s = '';
  var xmlHttp_getcountrylijst=GetXmlHttpObject();
  if (xmlHttp_getcountrylijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getcountrylijst.php";
  url+="?v="+visible;
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid("txt").innerHTML+="<br>{"+url+"}";
  xmlHttp_getcountrylijst.open("GET",url,false);
  xmlHttp_getcountrylijst.send(null);
  if (xmlHttp_getcountrylijst.status==200) {
    s=xmlHttp_getcountrylijst.responseText;
//getid("txt").innerHTML+="<br>"+s;
  }
  return s;
}

function gettitlelijst(visible) {
  if (visible==null) visible=1; //1=alleen zichtbaar
  var s = '';
  var xmlHttp_gettitlelijst=GetXmlHttpObject();
  if (xmlHttp_gettitlelijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_gettitlelijst.php";
  url+="?v="+visible;
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid("txt").innerHTML+="<br>{"+url+"}";
  xmlHttp_gettitlelijst.open("GET",url,false);
  xmlHttp_gettitlelijst.send(null);
  if (xmlHttp_gettitlelijst.status==200) {
    s=xmlHttp_gettitlelijst.responseText;
//getid("txt").innerHTML+="<br>"+s;
  }
  return s;
}

function getprovincelijst(cid) {
  if (cid==null) cid='';
  var s = '';
  var xmlHttp_getprovincelist=GetXmlHttpObject();
  if (xmlHttp_getprovincelist==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getprovincelijst.php";
  url+="?cid="+cid;
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid("txt").innerHTML+="<br>{"+url+"}";
  xmlHttp_getprovincelist.open("GET",url,false);
  xmlHttp_getprovincelist.send(null);
  if (xmlHttp_getprovincelist.status==200) {
    s=xmlHttp_getprovincelist.responseText;
//getid("txt").innerHTML+="<br>"+s;
  }
  return s;
}

function getmediumlijst() {
  var s = '';
  var xmlHttp_getmediumlijst=GetXmlHttpObject();
  if (xmlHttp_getmediumlijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getmediumlijst.php";
  url+="?owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
  xmlHttp_getmediumlijst.open("GET",url,false);
  xmlHttp_getmediumlijst.send(null);
  if (xmlHttp_getmediumlijst.status==200) s=xmlHttp_getmediumlijst.responseText;
  return s;
}

function getgroupkindlijst() {
  var s = '';
  var xmlHttp_getgroupkindlijst=GetXmlHttpObject();
  if (xmlHttp_getgroupkindlijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getgroupkindlijst.php";
  url+="?owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
  xmlHttp_getgroupkindlijst.open("GET",url,false);
  xmlHttp_getgroupkindlijst.send(null);
  if (xmlHttp_getgroupkindlijst.status==200) s=xmlHttp_getgroupkindlijst.responseText;
  return s;
}

function gettarifflijst() {
  var s = '';
  var xmlHttp_getgroupkindlijst=GetXmlHttpObject();
  if (xmlHttp_getgroupkindlijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_gettarifflijst.php";
  url+="?owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
  xmlHttp_getgroupkindlijst.open("GET",url,false);
  xmlHttp_getgroupkindlijst.send(null);
  if (xmlHttp_getgroupkindlijst.status==200) s=xmlHttp_getgroupkindlijst.responseText;
  return s;
}

function getledgercodelijst(purchase,sale) {
  if (purchase==null) purchase=1;
  if (sale==null) sale=1;
  var s = '';
  var xmlHttp_getledgercodelijst=GetXmlHttpObject();
  if (xmlHttp_getledgercodelijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getledgercodelijst.php";
  url+="?vp="+purchase;
  url+="&vs="+sale;
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid('txt').innerHTML+='<br>'+url;
  xmlHttp_getledgercodelijst.open("GET",url,false);
  xmlHttp_getledgercodelijst.send(null);
  if (xmlHttp_getledgercodelijst.status==200) s=xmlHttp_getledgercodelijst.responseText;
//getid('txt').innerHTML+='<br>'+s;
  return s;
}

/*
function getsupplierlijst() {
//getid("txt").innerHTML+="|getsupplierlist";
  var s = '';
  var xmlHttp_getsupplierlist=GetXmlHttpObject();
  if (xmlHttp_getsupplierlist==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="digitalekantoor_getsupplierlist.php";
  url+="?owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid('txt').innerHTML+='<br>'+url;
  xmlHttp_getsupplierlist.open("GET",url,false);
  xmlHttp_getsupplierlist.send(null);
  if (xmlHttp_getsupplierlist.status==200) {
    s=xmlHttp_getsupplierlist.responseText;
//getid('txt').innerHTML+='<br>'+s;
  }
  return s;
}
*/

function getcustomerlijst(ids) {
  if (ids==null) ids='';
  var s = '';
  var xmlHttp_getcustomerlijst=GetXmlHttpObject();
  if (xmlHttp_getcustomerlijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getcustomerlijst.php";
  url+="?ids="+ids;
  url+="&cg="+setting_withcustomergroup;
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid('txt').innerHTML+='<br>{'+url+'}';
  xmlHttp_getcustomerlijst.open("GET",url,false);
  xmlHttp_getcustomerlijst.send(null);
  if (xmlHttp_getcustomerlijst.status==200) {
    s=xmlHttp_getcustomerlijst.responseText;
//getid('txt').innerHTML+='<br>'+s;
    s=decode_special(s);
  }
  return s;
}

/*
function getcustomerlocationlijst(cid,v) {
  if (cid==null) cid='';
  if (v==null) v='0';
  var s = '';
  var xmlHttp_getcustomerlocationlijst=GetXmlHttpObject();
  if (xmlHttp_getcustomerlocationlijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="digitalekantoor_getcustomerlocationlijst.php";
  url+="?cid="+cid;
  url+="&v="+v;
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid('txt').innerHTML+='<br>{'+url+'}';
  xmlHttp_getcustomerlocationlijst.open("GET",url,false);
  xmlHttp_getcustomerlocationlijst.send(null);
  if (xmlHttp_getcustomerlocationlijst.status==200) {
    s=xmlHttp_getcustomerlocationlijst.responseText;
//getid('txt').innerHTML+='<br>'+s;
    s=decode_special(s);
  }
  return s;
}
*/

function getpropertylijst(pgid,visible) {
  if (pgid==null) pgid='';
  if (visible==null) visible=0;
  var s = '';
  var xmlHttp_getpropertylijst=GetXmlHttpObject();
  if (xmlHttp_getpropertylijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getpropertylijst.php";
  url+="?pgid="+pgid;
  url+="&vo="+visible;
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid('txt').innerHTML+='<br>{'+url+'}';
  xmlHttp_getpropertylijst.open("GET",url,false);
  xmlHttp_getpropertylijst.send(null);
  if (xmlHttp_getpropertylijst.status==200) {
    s=xmlHttp_getpropertylijst.responseText;
//getid('txt').innerHTML+='<br>'+s;
    s=decode_special(s);
  }
  return s;
}

function getselectionpropertylijst(pgid,visible) {
  if (pgid==null) pgid='';
  if (visible==null) visible=0;
  var s = '';
  var xmlHttp_getpropertylijst=GetXmlHttpObject();
  if (xmlHttp_getpropertylijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getselectionpropertylijst.php";
  url+="?pgid="+pgid;
  url+="&vo="+visible;
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid('txt').innerHTML+='<br>{'+url+'}';
  xmlHttp_getpropertylijst.open("GET",url,false);
  xmlHttp_getpropertylijst.send(null);
  if (xmlHttp_getpropertylijst.status==200) {
    s=xmlHttp_getpropertylijst.responseText;
//getid('txt').innerHTML+='<br>'+s;
    s=decode_special(s);
  }
  return s;
}

function getproductlijst(pgid,visible) {
  if (pgid==null) pgid='';
  if (visible==null) visible=0;
  var s = '';
  var xmlHttp_getproductlijst=GetXmlHttpObject();
  if (xmlHttp_getproductlijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getproductlijst.php";
  url+="?pgid="+pgid;
  url+="&vo="+visible;
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid('txt').innerHTML+='<br>{'+url+'}';
  xmlHttp_getproductlijst.open("GET",url,false);
  xmlHttp_getproductlijst.send(null);
  if (xmlHttp_getproductlijst.status==200) {
    s=xmlHttp_getproductlijst.responseText;
//getid('txt').innerHTML+='<br>'+s;
    s=decode_special(s);
  }
  return s;
}

function gethouseproductlijst(hid,pid,dat,tid) {
  if (hid==null) hid='';
  if (pid==null) pid='';
  if (dat==null) dat='';
  if (tid==null) tid='';
  var s = '';
  var xmlHttp_getproductlijst=GetXmlHttpObject();
  if (xmlHttp_getproductlijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_gethouseproductlijst.php";
  url+="?hid="+hid;
  url+="&pid="+pid;
  url+="&tid="+tid;
  if (dat!='')
  url+="&dat="+Math.floor(dat/1000);
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid('txt').innerHTML+='<br>{'+url+'}';
  xmlHttp_getproductlijst.open("GET",url,false);
  xmlHttp_getproductlijst.send(null);
  if (xmlHttp_getproductlijst.status==200) {
    s=xmlHttp_getproductlijst.responseText;
//getid('txt').innerHTML+='<br>'+s;
    s=decode_special(s);
  }
  return s;
}

function getproductpricelijst(pid,dat) {
  var s = '';
  var xmlHttp_getproductpricelijst=GetXmlHttpObject();
  if (xmlHttp_getproductpricelijst==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getproductpricelijst.php";
  url+="?pid="+pid;
  url+="&dat="+Math.floor(dat/1000);
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid('txt').innerHTML+='<br>{'+url+'}';
  xmlHttp_getproductpricelijst.open("GET",url,false);
  xmlHttp_getproductpricelijst.send(null);
  if (xmlHttp_getproductpricelijst.status==200) {
    s=xmlHttp_getproductpricelijst.responseText;
//getid('txt').innerHTML+='<br>'+s;
    s=decode_special(s);
  }
  return s;
}

/*
function getpersoneelnamen(ids) {
  var s = '';
  if (ids!='') {
    var xmlHttp_getpersoneelnamen=GetXmlHttpObject();
    if (xmlHttp_getpersoneelnamen==null) {
      alert ("Browser does not support HTTP Request");
      return s;
    }
    var url="digitalekantoor_getpersoneelnamen.php";
    url+="?ids="+ids;
    url+="&owner="+common_owneridcode;
    url+="&path="+common_path;
    url+="&seed="+Math.random();
    xmlHttp_getpersoneelnamen.open("GET",url,false);
    xmlHttp_getpersoneelnamen.send(null);
    if (xmlHttp_getpersoneelnamen.status==200) s=xmlHttp_getpersoneelnamen.responseText;
  }
  return s;
}
*/

function getklantnamen(ids) {
  var s = '';
  if (ids!='') {
    var xmlHttp_getklantnamen=GetXmlHttpObject();
    if (xmlHttp_getklantnamen==null) {
      alert ("Browser does not support HTTP Request");
      return s;
    }
    var url="mijnaccommodatie_getklantnamen.php";
    url+="?ids="+ids;
    url+="&owner="+common_owneridcode;
    url+="&path="+common_path;
    url+="&seed="+Math.random();
    xmlHttp_getklantnamen.open("GET",url,false);
    xmlHttp_getklantnamen.send(null);
    if (xmlHttp_getklantnamen.status==200) s=xmlHttp_getklantnamen.responseText;
  }
  return s;
}


/*
function getownernaam(id) {
  var s = '';
  if (id!='') {
    var xmlHttp_getownernaam=GetXmlHttpObject();
    if (xmlHttp_getownernaam==null) {
      alert ("Browser does not support HTTP Request");
      return s;
    }
    var url="mijncvg_getownernaam.php";
    url+="?o="+id;
    url+="&owner="+common_owneridcode;
    url+="&path="+common_path;
    url+="&seed="+Math.random();
    xmlHttp_getownernaam.open("GET",url,false);
    xmlHttp_getownernaam.send(null);
    if (xmlHttp_getownernaam.status==200) s=xmlHttp_getownernaam.responseText;
  }
  return s;
}
*/

function getnewbookcode(year) {
  var s = '';
  var xmlHttp_getownernaam=GetXmlHttpObject();
  if (xmlHttp_getownernaam==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var url="mijnaccommodatie_getnewbookcode.php";
  url+="?y="+year;
  url+="&owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
  xmlHttp_getownernaam.open("GET",url,false);
  xmlHttp_getownernaam.send(null);
  if (xmlHttp_getownernaam.status==200) s=xmlHttp_getownernaam.responseText;
  return s;
}

function controleerhuiskoppelingen() {
  var s = '';
  var xmlHttp_updatemutationdate=GetXmlHttpObject();
  if (xmlHttp_updatemutationdate==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var s='';
  var url="mijnaccommodatie_controleerhuiskoppelingen.php";
  url+="?owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid("txt").innerHTML+="<br>{"+url+"}";
  xmlHttp_updatemutationdate.open("GET",url,false);
  xmlHttp_updatemutationdate.send(null);
  if (xmlHttp_updatemutationdate.status==200) s=xmlHttp_updatemutationdate.responseText;
//getid("txt").innerHTML+=s;
  return s;
}

function controleergekoppeldehuizen() {
  var s = '';
  var xmlHttp_updatemutationdate=GetXmlHttpObject();
  if (xmlHttp_updatemutationdate==null) {
    alert ("Browser does not support HTTP Request");
    return s;
  }
  var s='';
  var url="mijnaccommodatie_controleergekoppeldehuizen.php";
  url+="?owner="+common_owneridcode;
  url+="&path="+common_path;
  url+="&seed="+Math.random();
//getid("txt").innerHTML+="<br>{"+url+"}";
  xmlHttp_updatemutationdate.open("GET",url,false);
  xmlHttp_updatemutationdate.send(null);
  if (xmlHttp_updatemutationdate.status==200) s=xmlHttp_updatemutationdate.responseText;
//getid("txt").innerHTML+=s;
  return s;
/*
  var sql='';
  sql='update occupation, house'+
      ' set occupation.linkedhouseids=house.linkedhouseids'+
      ', occupation.createddate=unix_timestamp()'+
      ' where (occupation.active=1) and (occupation.recordstatus>0)'+
      ' and (occupation.houseid=house.houseid) and (house.active=1)'+
      " and (ifnull(occupation.linkedhouseids,'')<>ifnull(house.linkedhouseids,''))";
  executesql(sql);
/* */
}

function getpictureurlext(cvgcode,nr,size,ext) {
  if (size==null) size='s';
  if (size=='') size='s';
  if (nr==null) nr=1;
  if (nr<1) nr=1;
  size=size.toLowerCase();
  cvgcode=cvgcode.toLowerCase();
  if (nr<10) var ext='_0'+(nr-0)+ext;
        else var ext='_'+nr+ext;
  //return 'http://'+ApplicationUrl+'/picture/'+common_owneridcode+'/'+cvgcode+'/'+size+'/'+cvgcode+ext;
  return './picture/'+common_owneridcode+'/'+cvgcode+'/'+size+'/'+cvgcode+ext;
}

function getpictureurl(cvgcode,nr,size) {
  return getpictureurlext(cvgcode,nr,size,'.jpg');
}

/*
function maakmailcode(bookingid,customerid,ownerid) {
  var s='';
  if ((bookingid!='')&&(bookingid!='0')) {
    if (s!='') s+='|'; s+='b='+bookingid;
  } else {
    if ((customerid!='')&&(customerid!='0')) { if (s!='') s+='|'; s+='d='+customerid; }
    if ((ownerid!='')&&(ownerid!='0')) { if (s!='') s+='|'; s+='v='+ownerid; }
  }
  if (s!='') s='  '+setting_emailmailcode+'=['+s+']';
  return s;
}

*/

function readdir(dir,ext) {
  var s = '';
  var xmlHttp_readdir=GetXmlHttpObject();
  if (xmlHttp_readdir==null) {
    alert ("Browser does not support HTTP Request");
    return;
  }
  var url="mijnaccommodatie_readdir.php";
  url+="?dir="+dir;
  url+="&ext="+ext;
  url+="&seed="+Math.random();
//getid("txt").innerHTML+="<br>{"+url+"}";
  xmlHttp_readdir.open("GET",url,false);
  xmlHttp_readdir.send(null);
  if (xmlHttp_readdir.status==200) s=xmlHttp_readdir.responseText;
//getid("txt").innerHTML+=s;
  return s;
}

function downloadasfile(fn,dt) {
  var xmlHttp_downloadasfile=GetXmlHttpObject();
  if (xmlHttp_downloadasfile==null) {
    alert ("Browser does not support HTTP Request");
    return;
  }
  var url="mijnaccommodatie_downloadasfile.php";
  var data="fn="+fn; //filename
    data+="&dt="+encode_special(dt); //data
    data+="&owner="+common_owneridcode;
    data+="&path="+common_path;
    data+="&seed="+Math.random();
//getid("txt").innerHTML+="<br>{"+url+"} {"+data+"}";
  xmlHttp_downloadasfile.open("POST",url,false);
  xmlHttp_downloadasfile.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
  xmlHttp_downloadasfile.send(data);
  if (xmlHttp_downloadasfile.status==200) {
    var s=xmlHttp_downloadasfile.responseText;
//getid("txt").innerHTML+="<br>["+s+']';
    if (s!="") window.open("mijnaccommodatie_download.php?filename="+s);
    return s;
  }
}

function sendemail(bookingid,customerid,ownerid,
                   fromaddress,toaddress,ccaddress,subject,
                   plaintext,htmltext,attachments,soort) {
  var data="bookingid="+bookingid;
     data+="|customerid="+customerid;
     data+="|ownerid="+ownerid;
     data+="|fromaddress="+fromaddress;
     data+="|toaddress="+toaddress;
     data+="|ccaddress="+ccaddress;
     data+="|subject="+subject;
     data+="|plaintext="+plaintext;
     data+="|htmltext="+htmltext;
     data+="|attachments="+attachments;
     data+="|soort="+soort;
  document.sendemailform.sendemaildata.value=data;
  if (Microsoft)
    var newWin = window.open("sendemail.html", "", 'width=740, height=760,menubar=no,location=no,status=no,toolbar=no,scrollbars=no');
  else
    var newWin = window.open("sendemail.html", "", 'width=740, height=700,status=no');
  newWin.focus();
}

function doopenhelp(pagename) {
  if (Microsoft)
    window.open('help.php?page='+pagename,null,"width=800,height=680,menubar=no,location=no,status=no,toolbar=no,scrollbars=auto");
  else
    window.open('help.php?page='+pagename,null,"width=800,height=660,scrollbars=1");
}

function copyrightstring() {
  var d=new Date();
  var t='';
  t+='<br>&copy; 2007-'+d.getFullYear()+' CVG Service';
//  t+='<br>&copy; 2007-'+d.getFullYear()+' <img src="/images/cvg_logo.png" border="0">';
  return t;
}

