﻿prefix='ctl00_';
zoomStatus = 1;
var mapID;
var stadID;
var tpID;
var vertrekDatum;
var terugDatum;
var flightExtra = new Array();
var selFlights = new Array();
var bookedExtras = new Array();
var extraPrices = new Array();
var favCities = new Array();
var extraTabelID = new Array();
var extPersons = 1;
var pricechange = false;
var barTO;

var bartxt1;
var bartxt2;

var priceObj;
var priceSpec='';

var hotelTO;

var doneLoading=false;

var combos=new Array();

var numRoom1 = '';
var numRoom2 = '';
var numRoom3 = '';

var formHeen = '';
var formTerug='';

var formVolw;
var formKind;
var formBaby;

var formTransport=''

var hotelid='';

if (document.layers){
  //Netscape 4 specific code
  pre = 'document.';
  preobj = 'document';
  endobj = '';
  post = '';
} else if (document.getElementById) {
  //Netscape 6 specific code
  pre = 'document.getElementById("';
  preobj = 'document.getElementById("';
  endobj = '")';
  post = '").style';
} else {
  //IE4+ specific code
  pre = 'document.all.';
  preobj = 'document.all';
  endobj = '';
  post = '.style';
}

function showMenu(panel, img, imgNav) {

    var showPanel = gO(panel);
    var foldImage = gO(img);
    var foldImageNav = gO(imgNav);

    if (showPanel.style.display == 'inline') {
        showPanel.style.display = 'none';
        foldImage.src = '/App_Image/icon/plus.png';
        foldImageNav.src = '/App_Image/icon/plus.png';
        foldImage.alt = 'Toon menu';
        foldImageNav.alt = 'Toon menu';
    } else {
        showPanel.style.display = 'inline';
        foldImage.src = '/App_Image/icon/min.png';
        foldImageNav.src = '/App_Image/icon/min.png';
        foldImage.alt = 'Verberg menu';
        foldImageNav.alt = 'Verberg menu';
    }
}

function showDivElement(panel, img) {

    var showPanel = gO(panel);
    var foldImage = gO(img);
    var Divline = gO('divLine');

    if (showPanel.style.display == 'inline') {
        showPanel.style.display = 'none';
        Divline.style.display = 'none';
        foldImage.src = '/App_Image/button/panel_extend.png';
        foldImage.alt = 'Toon menu';
    } else {
        showPanel.style.display = 'inline';
        Divline.style.display = 'inline';
        foldImage.src = '/App_Image/button/panel_shrink.png';
        foldImage.alt = 'Verberg menu';
    }
}

function setNBmijnstedentrips(type){
    if (type == 'maand') {
        var maandCheck = gO('maandnb');
        maandCheck.src = '/App_Image/check.gif';
    } else {
        var weekCheck = gO('weeknb');
        weekCheck.src = '/App_Image/check.gif';
    }
}

function checkNB(img) {
    var imgObj = gO(img);

    if (img == 'maandnb') {
        var maandCheck = gO('ctl00_pageContent_nieuwsbriefMaandValue');
        if (maandCheck.value == 'false') {
            imgObj.src = '/App_Image/check.gif';
            maandCheck.value = 'true';
        } else {
            imgObj.src = '/App_Image/nocheck.gif';
            maandCheck.value = 'false';
        }
    } else {
        var weekCheck = gO('ctl00_pageContent_nieuwsbriefWeekValue');
        if (weekCheck.value == 'false') {
            imgObj.src = '/App_Image/check.gif';
            weekCheck.value = 'true';
        } else {
            imgObj.src = '/App_Image/nocheck.gif';
            weekCheck.value = 'false';
        }
    }
}

function buttonOver(myobj, over)
{
    var to=myobj;
    
    if (to.tBodies)
    {
        to=to.tBodies[0];
    }
    
    to=to.firstChild.firstChild;

    while (to.nextSibling.style.backgroundImage.indexOf('green_b')==-1)
    {
        to=to.nextSibling;
    }
    
    to=to.nextSibling;
            
    if (over)
    {
        to.style.backgroundImage='url('+mouseover.src+')';
    } else {
        to.style.backgroundImage='url('+mouseout.src+')';        
    }
}

function addDDitem(ddbox, dditem)
{
    try
    {
        if (browser.isIE)
        {
            var textnode = document.createTextNode(dditem.label);
            dditem.appendChild(textnode);
        }
    }  catch(ex) {
    
    }

    try
    {
        ddbox.appendChild(dditem);
    } catch(ex) {
        
        try
        {
            ddbox.options.add(dditem);
        } catch(ex2) {
            ddbox.options.add(dditem, null);
        }       
    }    
}

function rw(myobj)
{
    if (myobj) { myobj.style.backgroundColor = '#FFFFFF'; } else { alert(myobj); }
    
    var tObj=gO('formAlert');
    var bObj=gO('formAlertBig');
    
    if(tObj)
    {
        tObj.style.display='none';    
    }    
    
    if(bObj)
    {
        bObj.style.display='none';    
    }    
     
}

function checkSubmit(pagina)
{
    var show = true;
    var fO = true;
    var eM = '';
    var eX = 710;
    var eY = 0;
    var cO;
    
    var emRE = new RegExp('^([0-9a-zA-Z]+([_.-]?[0-9a-zA-Z]+)*@[0-9a-zA-Z]+[0-9,a-z,A-Z,.,-]*(.){1}[a-zA-Z]{2,4})+$');
    var pcRE = new RegExp('^[0-9]{4} ?([a-z]|[A-Z]){2} ?$');
    var tnRE = new RegExp('((^[0-9]{2}[ -]?[0-9]{8}$)|(^[0-9]{3}[ -]?[0-9]{7}$)|(^[0-9]{4}[ -]?[0-9]{6}$))');
    var mnRE = new RegExp('(^06[ -]?[0-9]{8}$)');

    var eA = 0;

    switch (pagina.toLowerCase()) {
        case 'checkmail':
            eM = '';
            eA = 185;
            eM = 'Dit e-mailadres ontvangt geen nieuwsbrief';
            fO = false; eX = 1005; eY = 645; cO = gO('klantemail');
            break;
        case 'ilikestedentrips':
            eA = 185;
            if (eM == '' && gO('klantemail').value == '') { eM = 'Vul uw e-mailadres in'; fO = false; eX = 1005; eY = 645; cO = gO('klantemail'); }
            if (eM == '') {
                if (!emRE.test(gO('klantemail').value)) {
                    fO = false;
                    eX = 1005;
                    eY = 645;
                    eM = 'Het e-mailadres is geen correct adres.';
                    cO = gO('klantemail');
                } else {
                    fO = false;
                    show = false;
                    var clientEmail = gO('klantemail').value;
                    Ajax_Code.checkEmail(clientEmail, SucceededCallback, FailedCallback);
                }
            }
            break;

        case 'nieuwsbrief':
            eA = 185;
            if (eM == '' && gO('ctl00_pageContent_klantEmail').value == '') { eM = 'Vul uw e-mailadres in'; fO = false; eX = 685; eY = eA; cO = gO('ctl00_pageContent_klantEmail'); }

            if (eM == '') {
                if (!emRE.test(gO('ctl00_pageContent_klantEmail').value)) {
                    fO = false;
                    eX = 685;
                    eY = eA;
                    eM = 'Het e-mailadres is geen correct adres.';
                    cO = gO('ctl00_pageContent_klantEmail');
                }
            }

            if (eM == '' && gO('ctl00_pageContent_klantVnaam').value == '') { eM = 'Vul uw voornaam of initiaal in'; fO = false; eX = 685; eY = eA+28; cO = gO('ctl00_pageContent_klantVnaam'); }
            if (eM == '' && gO('ctl00_pageContent_klantAnaam').value == '') { eM = 'Vul uw achternaam in'; fO = false; eX = 685; eY = eA+84; cO = gO('ctl00_pageContent_klantAnaam'); }
            if (eM == '' && gO('ctl00_pageContent_gebDag_currentDD').value == '0') { eM = 'Vul uw geboortedag in'; fO = false; eX = 685; eY = eA+113; cO = gO('ctl00_pageContent_gebDag_currentDD'); }
            if (eM == '' && gO('ctl00_pageContent_gebMnd_currentDD').value == '0') { eM = 'Vul uw geboortemaand in'; fO = false; eX = 685; eY = eA+113; cO = gO('ctl00_pageContent_gebMnd_currentDD'); }
            if (eM == '' && gO('ctl00_pageContent_gebJaa_currentDD').value == '0') { eM = 'Vul uw geboortejaar in'; fO = false; eX = 685; eY = eA+113; cO = gO('ctl00_pageContent_gebJaa_currentDD'); }
            if (eM == '' && !gO('ctl00_pageContent_klantSekse_0').checked && !gO('ctl00_pageContent_klantSekse_1').checked) { eM = 'Selecteer uw titel'; fO = false; eX = 685; eY = eA+143; }
            if (eM == '' && gO('ctl00_pageContent_nieuwsbriefMaandValue').value == 'false' && gO('ctl00_pageContent_nieuwsbriefWeekValue').value == 'false') { eM = 'Vink minimaal één nieuwsbrief aan.'; fO = false; eX = 685; eY = eA + 240; }
            break;

        case 'nieuwsbrief_opnieuw':
            eA = 185;
            if (eM == '' && gO('ctl00_pageContent_opnieuwEmail').value == '') { eM = 'Vul uw e-mailadres in'; fO = false; eX = 685; eY = 270; cO = gO('ctl00_pageContent_opnieuwEmail'); }

            if (eM == '') {
                if (!emRE.test(gO('ctl00_pageContent_opnieuwEmail').value)) {
                    fO = false;
                    eX = 685;
                    eY = 270;
                    eM = 'Het e-mailadres is geen correct adres.';
                    cO = gO('ctl00_pageContent_opnieuwEmail');
                }
            }

            if (eM == '' && gO('ctl00_pageContent_opnieuwVnaam').value == '') { eM = 'Vul uw voornaam of initiaal in'; fO = false; eX = 685; eY = 295; cO = gO('ctl00_pageContent_opnieuwVnaam'); }
            if (eM == '' && gO('ctl00_pageContent_nieuwsbriefMaandValue').value == 'false' && gO('ctl00_pageContent_nieuwsbriefWeekValue').value == 'false') { eM = 'Vink minimaal één nieuwsbrief aan.'; fO = false; eX = 685; eY = 395; }
            break;

        case 'nieuwsbrief_verificatie':
            if (eM == '' && gO('ctl00_pageContent_klantEmailadres').value == '') { eM = 'Vul uw e-mailadres in'; fO = false; eX = 685; eY = 182; cO = gO('ctl00_pageContent_klantEmailadres'); }

            if (eM == '') {
                if (!emRE.test(gO('ctl00_pageContent_klantEmailadres').value)) {
                    fO = false;
                    eX = 685;
                    eY = 182;
                    eM = 'Het e-mailadres is geen correct adres.';
                    cO = gO('ctl00_pageContent_klantEmailadres');
                }
            }


            if (eM == '' && gO('ctl00_pageContent_klantVoornaam').value == '') { eM = 'Vul uw voornaam in'; fO = false; eX = 685; eY = 207; cO = gO('ctl00_pageContent_klantVoornaam'); }
            if (eM == '' && gO('ctl00_pageContent_KlantAchternaam').value == '') { eM = 'Vul uw achternaam in'; fO = false; eX = 685; eY = 259; cO = gO('ctl00_pageContent_KlantAchternaam'); }
            if (eM == '' && !gO('ctl00_pageContent_klantGeslacht_0').checked && !gO('ctl00_pageContent_klantGeslacht_1').checked) { eM = 'Selecteer uw titel'; fO = false; eX = 685; eY = 285; }

            if (eM == '' && gO('ctl00_pageContent_profielCheck').checked == true) {
                if (eM == '' && gO('ctl00_pageContent_klantWachtwoord').value == '') { cO = gO('ctl00_pageContent_klantWachtwoord'); eM = 'Vul een wachtwoord in'; fO = false; eX = 685; eY = 488; }
                if (eM == '' && gO('ctl00_pageContent_klantWachtwoord').value.length < 6) { cO = gO('ctl00_pageContent_klantWachtwoord'); eM = 'Wachtwoord moet minimaal 6 karakters zijn'; fO = false; eX = 685; eY = 488; }
                if (eM == '' && gO('ctl00_pageContent_bevestigWachtwoord').value == '') { cO = gO('ctl00_pageContent_bevestigWachtwoord'); eM = 'Vul uw wachtwoord nogmaals in'; fO = false; eX = 685; eY = 514; }
                if (eM == '' && gO('ctl00_pageContent_klantWachtwoord').value != gO('ctl00_pageContent_bevestigWachtwoord').value) { cO = gO('ctl00_pageContent_klantWachtwoord'); eM = 'Wachtwoorden komen niet overeen'; fO = false; eX = 685; eY = 488; }

                if (eM == '' && gO('ctl00_pageContent_klantStraatnaam').value == '') { eM = 'Vul uw straatnaam in'; fO = false; eX = 685; eY = 568; cO = gO('ctl00_pageContent_klantStraatnaam'); }
                if (eM == '' && gO('ctl00_pageContent_KlantHuisnr').value == '') { eM = 'Vul uw huisnummer in'; fO = false; eX = 685; eY = 568; cO = gO('ctl00_pageContent_KlantHuisnr'); }
                if (eM == '' && gO('ctl00_pageContent_KlantPostcode').value == '') { eM = 'Vul uw postcode in'; fO = false; eX = 685; eY = 593; cO = gO('ctl00_pageContent_KlantPostcode'); }
                if (eM == '') {
                    if (gO('ctl00_pageContent_KlantPostcode').value != '') {
                        if (!pcRE.test(gO('ctl00_pageContent_KlantPostcode').value)) {
                            fO = false;
                            eX = 685;
                            eY = 593;
                            eM = 'De postcode is geen correcte postcode';
                            cO = gO('ctl00_pageContent_KlantPostcode');
                        }
                    }
                }

                if (eM == '' && gO('ctl00_pageContent_klantWoonplaats').value == '') { eM = 'Vul uw woonplaats in'; fO = false; eX = 685; eY = 620; cO = gO('ctl00_pageContent_klantWoonplaats'); }
                if (eM == '' && gO('ctl00_pageContent_klantTelefoonnr').value == '') {
                    eM = 'Vul uw telefoonnummer in'; fO = false; eX = 685; eY = 662; cO = gO('ctl00_pageContent_klantTelefoonnr');
                }

                if (eM == '') {
                    if (gO('ctl00_pageContent_klantTelefoonnr').value != '') {
                        if (!tnRE.test(gO('ctl00_pageContent_klantTelefoonnr').value)) { cO = gO('ctl00_pageContent_klantTelefoonnr'); fO = false; eX = 685; eY = 662; eM = 'Het tel.nummer heeft verkeerd formaat.'; }
                    }
                }
            }
            break;
    case 'nieuwsbrief_afmelden_uniek':
            if (eM == '' && gO('ctl00_pageContent_afmeldNB').value == '') { eM = 'Selecteer een nieuwsbrief'; fO = false; eX = 685; eY = 173; cO = gO('ctl00_pageContent_afmeldNB'); }

            break;
    case 'nieuwsbrief_afmelden':
        if (eM == '' && gO('ctl00_pageContent_afmeldNB').value == '') { eM = 'Selecteer een nieuwsbrief'; fO = false; eX = 685; eY = 173; cO = gO('ctl00_pageContent_afmeldNB'); }

        if (eM == '' && gO('ctl00_pageContent_afmeldEmail').value == '') { eM = 'Vul uw e-mailadres in'; fO = false; eX = 685; eY = 200; cO = gO('ctl00_pageContent_afmeldEmail'); } 
            
            if (eM=='')
            {
                if (!emRE.test(gO('ctl00_pageContent_afmeldEmail').value))
                {
                    fO=false;
                    eX = 685;
                    eY = 200;
                    eM='Het e-mailadres is geen correct adres.';
                    cO=gO('ctl00_pageContent_afmeldEmail'); 
                }
            }
        break;

    case 'nieuwsbrief_wijzigen':
        eA = 30;
        if (eM == '' && gO('ctl00_pageContent_currentEmail').value == '') { eM = 'Vul uw e-mailadres in'; fO = false; eX = 630; eY = eA; cO = gO('ctl00_pageContent_currentEmail'); }

        if (eM == '') {
            if (!emRE.test(gO('ctl00_pageContent_currentEmail').value)) {
                fO = false;
                eX = 630;
                eY = 175;
                eM = 'Het e-mailadres is geen correct adres.';
                cO = gO('ctl00_pageContent_currentEmail');
            }
        }

        if (eM == '' && gO('ctl00_pageContent_newEmail').value == '') { eM = 'Vul uw e-mailadres in'; fO = false; eX = 630; eY = eA + 26; cO = gO('ctl00_pageContent_newEmail'); }

        if (eM == '') {
            if (!emRE.test(gO('ctl00_pageContent_newEmail').value)) {
                fO = false;
                eX = 630;
                eY = eA + 26;
                eM = 'Het e-mailadres is geen correct adres.';
                cO = gO('ctl00_pageContent_newEmail');
            }
        }
        break;

        case 'profiel_verified':
        break;

        case 'profiel':
            if (eM=='' && !gO('ctl00_pageContent_geslacht_0').checked && !gO('ctl00_pageContent_geslacht_1').checked) { eM='Selecteer uw geslacht'; fO=false; eX = 735; eY=65; } 
            if (eM=='' && gO('ctl00_pageContent_voorNaam').value=='') { cO=gO('ctl00_pageContent_voorNaam'); eM='Vul uw voornaam in'; fO=false; eX = 735; eY=85; }
            if (eM=='' && gO('ctl00_pageContent_achterNaam').value=='') { cO=gO('ctl00_pageContent_achterNaam'); eM='Vul uw achternaam in'; fO=false; eX = 735; eY=133; }
            if (eM=='' && gO('ctl00_pageContent_gebDag_currentDD').value=='0') { cO=gO('ctl00_pageContent_gebDag_currentDD'); eM='Vul uw geboortedatum in'; fO=false; eX = 735; eY=157; }
            if (eM=='' && gO('ctl00_pageContent_gebMnd_currentDD').value=='0') { cO=gO('ctl00_pageContent_gebMnd_currentDD'); eM='Vul uw geboortedatum in'; fO=false; eX = 735; eY=157; }
            if (eM=='' && gO('ctl00_pageContent_gebJaa_currentDD').value=='0') { cO=gO('ctl00_pageContent_gebJaa_currentDD'); eM='Vul uw geboortedatum in'; fO=false; eX = 735; eY=157; }
            if (eM == '' && gO('ctl00_pageContent_straatNaam').value == '') { cO = gO('ctl00_pageContent_straatNaam'); eM = 'Vul uw straatnaam in'; fO = false; eX = 735; eY = 180; }
            if (eM == '' && gO('ctl00_pageContent_huisNummer').value == '') { cO = gO('ctl00_pageContent_huisNummer'); eM = 'Vul uw huisnummer in'; fO = false; eX = 735; eY = 180; }
            if (eM == '' && gO('ctl00_pageContent_postCode').value == '') { cO = gO('ctl00_pageContent_postCode'); eM = 'Vul uw postcode in'; fO = false; eX = 735; eY = 205; }

            if (eM == '') {
                if (gO('ctl00_pageContent_postCode').value != '') {
                    if (!pcRE.test(gO('ctl00_pageContent_postCode').value)) {
                        fO = false;
                        eX = 735;
                        eY = 205;
                        eM = 'De postcode is geen correcte postcode .';
                        cO = gO('ctl00_pageContent_postCode');
                    }
                }
            }

            if (eM == '' && gO('ctl00_pageContent_woonPlaats').value == '') { cO = gO('ctl00_pageContent_woonPlaats'); eM = 'Vul uw woonplaats in'; fO = false; eX = 735; eY = 228; }
            if (eM == '' && gO('ctl00_pageContent_eMail').value == '') { cO = gO('ctl00_pageContent_eMail'); eM = 'Vul uw e-mailadres in'; fO = false; eX = 735; eY = 275; }

            if (eM == '') {
                if (!emRE.test(gO('ctl00_pageContent_eMail').value)) {
                    fO = false;
                    eX = 735;
                    eY = 275;
                    eM = 'Het e-mailadres is geen correct adres.';
                    cO = gO('ctl00_pageContent_eMail');
                }
            }

            if (eM == '' && gO('ctl00_pageContent_telDag').value == '') { cO = gO('ctl00_pageContent_telDag'); eM = 'Vul een telefoonnummer in'; fO = false; eX = 735; eY = 300; }

            if (eM == '') {
                if (gO('ctl00_pageContent_telDag').value != '') {
                    if (!tnRE.test(gO('ctl00_pageContent_telDag').value)) { cO = gO('ctl00_pageContent_telDag'); fO = false; eX = 735; eY = 300; eM = 'Het tel.nummer heeft verkeerd formaat.'; }
                }
            }

            if (eM == '') {
                if (gO('ctl00_pageContent_telMobiel').value != '') {
                    var mobobj = gO('ctl00_pageContent_telMobiel');
                    if (mobobj) {
                        if (mobobj.value != '') {
                            if (!mnRE.test(mobobj.value)) { cO = mobobj; fO = false; eX = 735; eY = 322; eM = 'Het tel.nummer heeft verkeerd formaat.'; }
                        }
                    }
                }
            }
       
            if (eM=='')
            {
                if (eM=='' && gO('ctl00_pageContent_wachtwoord1').value=='') { cO=gO('ctl00_pageContent_wachtwoord1'); eM='Vul uw wachtwoord in'; fO=false; eX = 735; eY=360; }
                if (eM=='' && gO('ctl00_pageContent_wachtwoord2').value=='') { cO=gO('ctl00_pageContent_wachtwoord2'); eM='Vul uw wachtwoord nogmaals in'; fO=false; eX = 735; eY=382; }
                if (eM=='' && gO('ctl00_pageContent_wachtwoord1').value!=gO('ctl00_pageContent_wachtwoord2').value) { cO=gO('ctl00_pageContent_wachtwoord1'); eM='Wachtwoorden komen niet overeen'; fO=false; eX = 735; eY=360; }
                if (eM=='' && gO('ctl00_pageContent_wachtwoord1').value.length<6) { cO=gO('ctl00_pageContent_wachtwoord1'); eM='Wachtwoord moet minimaal 6 karakters zijn'; fO=false; eX = 735; eY=360; }
            }
        break;

    case 'profiel_opslaan':
        if (eM == '' && !gO('ctl00_pageContent_geslacht_0').checked && !gO('ctl00_pageContent_geslacht_1').checked) { eM = 'Selecteer uw geslacht'; fO = false; eX = 735; eY = 135; }
        if (eM == '' && gO('ctl00_pageContent_voorNaam').value == '') { cO = gO('ctl00_pageContent_voorNaam'); eM = 'Vul uw voornaam in'; fO = false; eX = 735; eY = 155; }
        if (eM == '' && gO('ctl00_pageContent_achterNaam').value == '') { cO = gO('ctl00_pageContent_achterNaam'); eM = 'Vul uw achternaam in'; fO = false; eX = 735; eY = 200; }
        if (eM == '' && gO('ctl00_pageContent_gebDag_currentDD').value == '0') { cO = gO('ctl00_pageContent_gebDag_currentDD'); eM = 'Vul uw geboortedatum in'; fO = false; eX = 735; eY = 225; }
        if (eM == '' && gO('ctl00_pageContent_gebMnd_currentDD').value == '0') { cO = gO('ctl00_pageContent_gebMnd_currentDD'); eM = 'Vul uw geboortedatum in'; fO = false; eX = 735; eY = 225; }
        if (eM == '' && gO('ctl00_pageContent_gebJaa_currentDD').value == '0') { cO = gO('ctl00_pageContent_gebJaa_currentDD'); eM = 'Vul uw geboortedatum in'; fO = false; eX = 735; eY = 225; }
        if (eM == '' && gO('ctl00_pageContent_straatNaam').value == '') { cO = gO('ctl00_pageContent_straatNaam'); eM = 'Vul uw straatnaam in'; fO = false; eX = 735; eY = 248; }
        if (eM == '' && gO('ctl00_pageContent_huisNummer').value == '') { cO = gO('ctl00_pageContent_huisNummer'); eM = 'Vul uw huisnummer in'; fO = false; eX = 735; eY = 248; }
        if (eM == '' && gO('ctl00_pageContent_postCode').value == '') { cO = gO('ctl00_pageContent_postCode'); eM = 'Vul uw postcode in'; fO = false; eX = 735; eY = 271; }

        if (eM == '') {
            if (gO('ctl00_pageContent_postCode').value != '') {
                var postcode = new RegExp('^[0-9]{4} ?([a-z]|[A-Z]){2}$');
                if (!postcode.test(gO('ctl00_pageContent_postCode').value)) {
                    fO = false;
                    eX = 735;
                    eY = 271;
                    eM = 'De postcode is geen correcte postcode .';
                    cO = gO('ctl00_pageContent_postCode');
                }
            }
        }

        if (eM == '' && gO('ctl00_pageContent_woonPlaats').value == '') { cO = gO('ctl00_pageContent_woonPlaats'); eM = 'Vul uw woonplaats in'; fO = false; eX = 735; eY = 297; }

        if (eM == '' && gO('ctl00_pageContent_eMail').value == '') { cO = gO('ctl00_pageContent_eMail'); eM = 'Vul uw e-mailadres in'; fO = false; eX = 735; eY = 337; }

        if (eM == '') {
            if (!emRE.test(gO('ctl00_pageContent_eMail').value)) {
                fO = false;
                eX = 735;
                eY = 337;
                eM = 'Het e-mailadres is geen correct adres.';
                cO = gO('ctl00_pageContent_eMail');
            }
        }

        if (eM == '' && gO('ctl00_pageContent_telDag').value == '') { cO = gO('ctl00_pageContent_telDag'); eM = 'Vul een telefoonnummer in'; fO = false; eX = 735; eY = 367; }
        if (eM == '') {
            if (gO('ctl00_pageContent_telDag').value != '') {
                if (!tnRE.test(gO('ctl00_pageContent_telDag').value)) { cO = gO('ctl00_pageContent_telDag'); fO = false; eX = 735; eY = 367; eM = 'Het tel.nummer heeft verkeerd formaat.'; }
            }
        }

        if (eM == '') {
            if (gO('ctl00_pageContent_telMobiel').value != '') {
                var mobobj = gO('ctl00_pageContent_telMobiel');
                if (mobobj) {
                    if (mobobj.value != '') {
                        if (!mnRE.test(mobobj.value)) { cO = mobobj; fO = false; eX = 735; eY = 389; eM = 'Het tel.nummer heeft verkeerd formaat.'; }
                    }
                }
            }
        }
        break;

    case 'contactgegevens':
        var errorStartX = 432;
        var errorStartY = 34;

        if (eM == '' && !gO('ctl00_pageContent_geslachtMan').checked && !gO('ctl00_pageContent_geslachtVrouw').checked) { eM = 'Selecteer uw geslacht'; fO = false; eX = errorStartX; eY = errorStartY + 11; }
        if (eM == '' && gO('ctl00_pageContent_voorNaam').value == '') { cO = gO('ctl00_pageContent_voorNaam'); eM = 'Vul uw voornaam in'; fO = false; eX = errorStartX; eY = errorStartY + 29; }
        if (eM == '' && gO('ctl00_pageContent_achterNaam').value == '') { cO = gO('ctl00_pageContent_achterNaam'); eM = 'Vul uw achternaam in'; fO = false; eX = errorStartX; eY = errorStartY + 74; }
        if (eM == '' && gO('ctl00_pageContent_gebDag_currentDD').value == '0') { cO = gO('ctl00_pageContent_gebDag_currentDD'); eM = 'Vul uw geboortedatum in'; fO = false; eX = errorStartX; eY = errorStartY + 98; }
        if (eM == '' && gO('ctl00_pageContent_gebMnd_currentDD').value == '0') { cO = gO('ctl00_pageContent_gebMnd_currentDD'); eM = 'Vul uw geboortedatum in'; fO = false; eX = errorStartX; eY = errorStartY + 98; }
        if (eM == '' && gO('ctl00_pageContent_gebJaa_currentDD').value == '0') { cO = gO('ctl00_pageContent_gebJaa_currentDD'); eM = 'Vul uw geboortedatum in'; fO = false; eX = errorStartX; eY = errorStartY + 98; }
        if (eM == '' && gO('ctl00_pageContent_postCode').value == '') { cO = gO('ctl00_pageContent_postCode'); eM = 'Vul uw postcode in'; fO = false; eX = errorStartX; eY = errorStartY + 122; }
        if (eM == '' && gO('ctl00_pageContent_huisNummer').value == '') { cO = gO('ctl00_pageContent_huisNummer'); eM = 'Vul uw huisnummer in'; fO = false; eX = errorStartX; eY = errorStartY + 146; }
        if (eM == '' && gO('ctl00_pageContent_straatNaam').value == '') { cO = gO('ctl00_pageContent_straatNaam'); eM = 'Vul de straatnaam in'; fO = false; eX = errorStartX+60; eY = errorStartY + 170; }
        if (eM == '' && gO('ctl00_pageContent_woonPlaats').value == '') { cO = gO('ctl00_pageContent_woonPlaats'); eM = 'Vul uw woonplaats in'; fO = false; eX = errorStartX+60; eY = errorStartY + 194; }
        if (eM == '' && gO('ctl00_pageContent_eMail').value == '') { cO = gO('ctl00_pageContent_eMail'); eM = 'Vul uw e-mailadres in'; fO = false; eX = errorStartX+60; eY = errorStartY + 231; }
        if (eM == '' && gO('ctl00_pageContent_telVast').value == '') { cO = gO('ctl00_pageContent_telVast'); eM = 'Vul uw telefoon nummer in'; fO = false; eX = errorStartX; eY = errorStartY + 255; }

        if (eM == '' && gO('ctl00_pageContent_thuisNaam').value == '') { cO = gO('ctl00_pageContent_thuisNaam'); eM = 'Vul de naam van de thuisblijver in'; fO = false; eX = errorStartX; eY = errorStartY + 340; }
        if (eM == '' && gO('ctl00_pageContent_thuisTel').value == '') { cO = gO('ctl00_pageContent_thuisTel'); eM = 'Vul het tel. nummer van de thuisblijver in'; fO = false; eX = errorStartX; eY = errorStartY + 364; }

        if (eM == '') {
            var checkObj = gO('ctl00_pageContent_profielChk');

            if (checkObj) {
                if (checkObj.checked) {
                    if (eM == '' && gO('ctl00_pageContent_wachtwoord1').value == '') { cO = gO('ctl00_pageContent_wachtwoord1'); eM = 'Vul uw wachtwoord in'; fO = false; eX = errorStartX; eY = errorStartY + 474; }
                    if (eM == '' && gO('ctl00_pageContent_wachtwoord2').value == '') { cO = gO('ctl00_pageContent_wachtwoord2'); eM = 'Vul uw wachtwoord nogmaals in'; fO = false; eX = errorStartX; eY = errorStartY + 498; }
                    if (eM == '' && gO('ctl00_pageContent_wachtwoord1').value != gO('ctl00_pageContent_wachtwoord2').value) { cO = gO('ctl00_pageContent_wachtwoord1'); eM = 'Wachtwoorden komen niet overeen'; fO = false; eX = errorStartX; eY = errorStartY + 498; }
                    if (eM == '' && gO('ctl00_pageContent_wachtwoord1').value.length < 6) { cO = gO('ctl00_pageContent_wachtwoord1'); eM = 'Wachtwoord moet minimaal 6 karakters zijn'; fO = false; eX = errorStartX; eY = errorStartY + 498; }
                }
            }
        }

        if (eM == '') {
            if (!emRE.test(gO('ctl00_pageContent_eMail').value)) {
                fO = false;
                eX = errorStartX;
                eY = errorStartY + 221;
                eM = 'Het e-mailadres is geen correct adres.';
                cO = gO('ctl00_pageContent_eMail');
            }
        }

        if (eM == '') {
            if (!pcRE.test(gO('ctl00_pageContent_postCode').value)) {
                fO = false;
                eX = errorStartX;
                eY = errorStartY + 155;
                eM = 'De postcode is geen correcte postcode .';
                cO = gO('ctl00_pageContent_postCode');
            }
        }


        if (eM == '') {
            if (!tnRE.test(gO('ctl00_pageContent_telVast').value.replace(' ', ''))) { cO = gO('ctl00_pageContent_telVast'); fO = false; eX = errorStartX; eY = errorStartY + 245; eM = 'Het tel.nummer heeft verkeerd formaat.'; }
            if (!tnRE.test(gO('ctl00_pageContent_thuisTel').value.replace(' ', ''))) { cO = gO('ctl00_pageContent_thuisTel'); fO = false; eX = errorStartX; eY = errorStartY + 358; eM = 'Het tel.nummer heeft verkeerd formaat.'; }
        }

        if (eM == '') {
            var mob_obj = gO('ctl00_pageContent_telMobiel');
            if (mob_obj) {
                if (mob_obj.value != '') {
                    if (!mnRE.test(mob_obj.value.replace(' ', ''))) { cO = mob_obj; fO = false; eX = errorStartX; eY = errorStartY + 293; eM = 'Het tel.nummer heeft verkeerd formaat.'; }
                }
            }
        }

        if (eM != '') {
            getStyle('groenDisabled').display = 'none';
        }
        break;
        
        case 'ideal':
            fO=true;    
        
            txt1str='\nEr wordt verbinding gemaakt met uw bank';
            txt2str='\nEen ogenblik geduld a.u.b.';
        break;
        
        default:
            fO=true;        
        break;
    }
    
    if (cO)
    {
        cO.style.backgroundColor='#FF8C01';
    }
    
    if (fO) 
    { 
        waitForIt();
        actualSubmit();
    } else {
        var myobj = gO('formAlert');
        
        if (myobj) {
            if (show) {
                myobj.style.display = 'inline';
            }

            myobj.style.left = eX.toString()+'px';
            myobj.style.top = eY.toString()+'px';
            myobj.innerHTML=eM;
        }
        
        fScrollTo(eY);
        
        return false;
    }
}


function submitForm(actie)
{
    gO(formAction).value = actie;
    
    setTimeout(actualSubmit, 510);
}

function actualSubmit() {
    //alert(document.forms['aspnetForm']);

    if (document.forms['aspnetForm'] == null) {
        document.forms[0].submit();
    } else {
        document.forms['aspnetForm'].submit();
    }
}

function checkBeschikbaarheid(myobj)
{
    var zbprefix=myobj.id.replace('checkBeschikbaarheid', '');
    var bestemming=gO(zbprefix+'Bestemming_DD').value;
    var personen=gO(zbprefix+'AantalVolw_DD').value;
    var heendatum=gO(zbprefix+'datumHeen_datumSelectieDagDD').value;
    var heenmaand=gO(zbprefix+'datumHeen_datumSelectieMndDD').value;
    var terugdatum=gO(zbprefix+'datumTerug_datumSelectieDagDD').value;
    var terugmaand=gO(zbprefix+'datumTerug_datumSelectieMndDD').value;
    
    var maandHeen=parseFloat(heenmaand.substr(0,2))-1;
    var maandTerug=parseFloat(terugmaand.substr(0,2))-1;
    
    var heendate=new Date(heenmaand.substr(2,4),maandHeen,heendatum);
    var terugdate=new Date(terugmaand.substr(2,4),maandTerug,terugdatum);
    var selectedTransport;
    var transports=new Array();
    transports=document.getElementsByName('transportOptions');
    for (transidx=0; transidx<transports.length; transidx++)
    {
        if (transports[transidx].checked)
        {
            selectedTransport=transports[transidx].value;
        }
    }
    
    //Error checking
    var formError='';
    var formX=0;
    var formY=0;
    var formObj;
    
    if (bestemming==0) { formError='Selecteer een stad.'; formX=185; formY=42; formObj=gO(zbprefix+'Bestemming_DD'); }
    //Todo:min days
    
    if (formError=='')
    {
        if (maandHeen!=heendate.getMonth()) { formError='Datum is niet correct.'; formX=185; formY=122; formObj=gO(zbprefix+'datumHeen_datumSelectieDagDD'); }
        if (maandTerug!=terugdate.getMonth()) { formError='Datum is niet correct.'; formX=185; formY=140; formObj=gO(zbprefix+'datumTerug_datumSelectieDagDD'); }
    }
        
    if (formError!='')
    {
        var myAlert=gO('formAlertR');
        myAlert.style.display='inline';
        myAlert.style.left=formX.toString()+'px';
        myAlert.style.top=formY.toString()+'px';
        myAlert.innerHTML=formError;
        
       	if (browser.isIE) {
            formObj.attachEvent("onfocus", alrtRem);
            //window.event.cancelBubble = true;
            //window.event.returnValue = false;
        }
        if (browser.isNS) {
            formObj.addEventListener("focus", alrtRem, true);
            //event.preventDefault();
        }
    } else {
        waitForIt(this);
        
        submitForm();
        //document.forms[0].submit();
    }
}

function alrtRem()
{
    gO('formAlertL').style.display='none';
    gO('formAlertR').style.display='none';
}

// Get Browser type
function Browser() {
    var myagent, s, i;

    this.isIE9 = false;
    this.isIE = false;
    this.isNS = false;
    this.version = null;

    myagent = navigator.userAgent;

    if (((i = myagent.indexOf("MSIE")) >= 0) || ((i = myagent.indexOf("Opera")) >= 0)) {
        this.isIE = true;
        this.version = parseFloat(myagent.substr(i + 4));

        if (this.version > 8) {
            this.isIE = true;
            this.isIE9 = true;
        }

        return;
    } else if ((i = myagent.indexOf("Netscape6/")) >= 0) {
        this.isNS = true;
        this.version = parseFloat(myagent.substr(i + 10));
        return;
    } else if ((i = myagent.indexOf("Gecko")) >= 0) {
        this.isNS = true;
        this.version = 6.1;
    }
    return;
}

var browser = new Browser();
	
function gO(objname)
{
    myObj = eval(preobj+objname+endobj);

    if (!myObj)
    {
        myObj = eval(preobj+prefix+objname+endobj);  
    }

    return myObj;
}

function getStyle(objname)
{
    try 
    {
        myObj = eval(preobj+objname+post);
    } catch(err) {
        try
        {
            myObj = eval(preobj+prefix+objname+post);   
        } catch(err) {
            alert(objname+': '+err);
        }
    }
        
    return myObj;
}

function PageScrollY() 
{
    if (window.pageYOffset) {
        return window.pageYOffset;
    }
    else {
        if (document.documentElement && document.documentElement.scrollTop) {
            return document.documentElement.scrollTop;
        }
        else if (document.body) {
            return document.body.scrollTop;
        }
    }
    return 0;
}

function PageScrollHeight() 
{
    if (window.innerHeight && window.scrollMaxY) {
        // Firefox
        yWithScroll = window.innerHeight + window.scrollMaxY;
    } else if (document.body.scrollHeight >= document.body.offsetHeight){ 
        // all but Explorer Mac
        yWithScroll = document.body.scrollHeight;
    } else { 
        // works in Explorer 6 Strict, Mozilla (not FF) and Safari
        yWithScroll = document.body.offsetHeight;
    }
    
    return yWithScroll; 
}

function PageScrollWidth() 
{
    if (window.innerWidth && window.scrollMaxX) {
        // Firefox
        yWithScroll = window.innerWidth + window.scrollMaxX;
    } else if (document.body.scrollWidth >= document.body.offsetWidth){ 
        // all but Explorer Mac
        yWithScroll = document.body.scrollWidth;
    } else { 
        // works in Explorer 6 Strict, Mozilla (not FF) and Safari
        yWithScroll = document.body.offsetWidth;
    }
    
    return yWithScroll; 
}

function BrowserHeight() 
{
    if (window.innerHeight) {
        return window.innerHeight - 17;
    }
    else {
        if (document.documentElement && document.documentElement.clientHeight) {
            return document.documentElement.clientHeight;
        }
        else if (document.body) {
            return document.body.clientHeight;
        }
    }
}

function BrowserWidth() 
{
    if (window.innerWidth) {
        return window.innerWidth - 17;
    }
    else {
        if (document.documentElement && document.documentElement.clientWidth) {
            return document.documentElement.clientWidth;
        }
        else if (document.body) {
            return document.body.clientWidth;
        }
    }
    return 0;
}

function enableControls(enable)
{
    var seeit;
    
    if (enable==true)
    { 
        seeit='visible';
    } else {
        seeit='hidden';
    }
    
}

function screenOverlay(show)
{
    if (show==true) {
        var myWidth = parseFloat(BrowserWidth())+'px';
        var myHeight = parseFloat(PageScrollHeight())+'px';
        
        enableControls(false);
        //hidePersistent();

        gO('disableScreen').innerHTML = jsFlash('disabled', '/flash/disabled.swf', 'text-align: center', 'middle', myWidth.toString(), myHeight.toString(), '<param name="scale" value="exactfit" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" />');
        //'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + myWidth + '" height="' + myHeight + '" id="disabled" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/flash/disabled.swf" /><param name="scale" value="exactfit" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><em_bed src="/flash/disabled.swf" quality="high" scale="exactfit" wmode="transparent" bgcolor="#ffffff" width="' + myWidth + '" height="' + myHeight + '" name="disabled" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
        //gO('disableScreen').innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + myWidth + '" height="' + myHeight + '" id="disabled" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/flash/disabled.swf" /><param name="scale" value="exactfit" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><em_bed src="/flash/disabled.swf" quality="high" scale="exactfit" wmode="transparent" bgcolor="#ffffff" width="' + myWidth + '" height="' + myHeight + '" name="disabled" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
        //gO('disableScreen').innerHTML = '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + myWidth + '" height="' + myHeight + '" id="disabled" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/flash/disabled.swf" /><param name="scale" value="exactfit" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><em_bed src="/flash/disabled.swf" quality="high" scale="exactfit" wmode="transparent" bgcolor="#ffffff" width="' + myWidth + '" height="' + myHeight + '" name="disabled" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
    } else {
        gO('disableScreen').innerHTML='';
        
        enableControls(true);
        //showPersistent();
    }
}

function resizeTop15()
{
    var totalLength = 0;
    var firstLength = 0;
        
    for (i=0; i<15; i++)
    {
        firstLength = firstLength + getTextWidth(gO('top15item'+(i+1).toString()));
    }                        

    var factor = 1250 / firstLength;
    var initWidth = 0;
    for (i=0; i<15; i++)
    {
        initWidth = parseInt(getStyle('top15item'+(i+1).toString()).fontSize.replace('%',''));
        
        getStyle('top15item'+(i+1).toString()).fontSize = (initWidth*factor).toString()+'%';
    }
    
    var myStyle = getStyle('top15Content');
    myStyle.position='absolute';
    
    var tableHeight = gO('top15Content').clientHeight;
    
    myStyle.position='';
    
    factor = 200 / tableHeight;

    if (factor!=1)
    {
        for (i=0; i<15; i++)
        {
            initWidth = parseInt(getStyle('top15item'+(i+1).toString()).fontSize.replace('%',''));
            
            getStyle('top15item'+(i+1).toString()).fontSize = (initWidth*factor).toString()+'%';
        }
    }
}


function getTextWidth(myObj)
{
    var txtWidth;
    
    myObj.style.visibility='hidden';
    myObj.style.position='absolute';
    
    txtWidth=myObj.clientWidth;
    
    myObj.style.position='';
    myObj.style.visibility='visible';
    
    return txtWidth;
}

var movingObj;

function retainScroll(myobj)
{
    if (PageScrollY().toString()!='0')
    {
        if (myobj.href.indexOf('?')>-1)
        {
            myobj.href=myobj.href+'&ms='+PageScrollY().toString();
        } else {
            myobj.href=myobj.href+'?ms='+PageScrollY().toString();
        }
    }
}

function importanceOrder (marker,b) 
{
    return GOverlay.getZIndex(marker.getPoint().lat()) + marker.importance*1000000;
}

function createSightMarker(point,iconurl)
{
    var tmpIcon = new GIcon(sightIcon);
    tmpIcon.image = 'http://www.stedentrips.nl/'+iconurl;

    var onmapOptions = { icon:tmpIcon , zIndexProcess:importanceOrder };
    //var onmapOptions = { icon:tmpIcon };

    var marker = new GMarker(point,onmapOptions);
    marker.importance = 3;
    
    return marker;
}

function createMarker(point,html,icon,hoturl) {
    var marker = new GMarker(point,icon);

    GEvent.addListener(marker, "click", function () {
        if (hoturl != '') {
            window.location.href = hoturl;
        }
    });
    
    return marker;
  }

function getQueryVar(varname)
{
    hu = window.location.search.substring(1).toLowerCase();
    gy = hu.split("&");
    
    for (i=0;i<gy.length;i++) {
        ft = gy[i].split("=");
        if (ft[0] == varname.toLowerCase()) 
        {
            return ft[1];
        }
    }
    return '0';
}

function extendMapImg(sizer)
{
    var previousCenter = map.getCenter();

    if (sizer!=1)
    {
        if (zoomStatus>1)
        {
            zoomStatus--;
        } else {
            zoomStatus = 1;
        }
    } else {
        if (zoomStatus<3)
        {
            zoomStatus++;
        } else {
            zoomStatus = 3;
        }
    }

    switch (zoomStatus)
    {
        case 1: 
            zoomMapObj.width='260px';
            mainImgObj.style.width='482px';
            mainImgObj.style.height='260px';
            
            zoomInImg.src='/App_Image/Icon/expand_left_disabled.png';
            zoomOutImg.src='/App_Image/Icon/expand_right_enabled.png';
        break;
        case 2: 
            zoomMapObj.width='371px';
            mainImgObj.style.width='371px';
            mainImgObj.style.height='200px';
            
            zoomInImg.src='/App_Image/Icon/expand_left_enabled.png';
            zoomOutImg.src='/App_Image/Icon/expand_right_enabled.png';            
        break;
        default: 
            zoomMapObj.width='482px';
            mainImgObj.style.width='260px';
            mainImgObj.style.height='140px';

            zoomInImg.src='/App_Image/Icon/expand_left_enabled.png';
            zoomOutImg.src='/App_Image/Icon/expand_right_disabled.png';              
        break;
    }        

    map.checkResize(); 
    map.setCenter(previousCenter); 
}

//function showHotelTypes(refcell)
//{
//    var myObj = refcell;
//    
//    while (myObj.id=='')
//    { 
//        myObj=myObj.parentNode;
//    }
//           
//    var myStyle = getStyle(myObj.id.substr(0,myObj.id.lastIndexOf("_"))+'_hotelTypes');
//    
//    switch(myStyle.display)
//    {
//        case 'inline':
//            //showPersistent();
//            myStyle.display = 'none';
//        break;
//        
//        default:
//            //hidePersistent();
//            myStyle.display = 'inline';
//        break;
//    }
//}

function showCityPanel()
{
    var myStyle = getStyle(stadPanelID);
    
    switch(myStyle.display)
    {
        case 'inline':
            showPersistent();
            myStyle.display = 'none';
        break;
        
        default:
            Ajax_Code.loadCities(stadPanelID, SucceededCallbackToo, FailedCallback);
        break;
    }
}

var persistent = new Array();

function hidePersistent()
{
    sIFR.rollback();
    
    var myCol = document.getElementsByTagName("object");
    
    for (i=0; i<myCol.length; i++)
    {
        if (myCol[i].id!='')
        {
            var myStyle = getStyle(myCol[i].id);
        }
        //myStyle.visibility='hidden';
    }
    
    return true;
}

function showPersistent()
{
    //sIFR.rollback();
    var applyProtocol = ('https:' == document.location.protocol ? 'https://' : 'http://');
    
    if(typeof sIFR == "function"){
        sIFR.replaceElement(named({ sSelector: "h1.pageTitle", sFlashSrc: applyProtocol+"www.stedentrips.nl/flash/eurostile_bold.swf", sColor: "#000000", sBgColor: "#FFFFFF", sWmode: "transparent" }));
        sIFR.replaceElement(named({ sSelector: "h1.pageTitleBrown", sFlashSrc: applyProtocol+"www.stedentrips.nl/flash/eurostile_bold.swf", sColor: "#B5A188", sBgColor: "#FFFFFF", sWmode: "transparent" }));
        sIFR.replaceElement(named({ sSelector: "h1.pageTitleOrange", sFlashSrc: applyProtocol + "www.stedentrips.nl/flash/eurostile_bold.swf", sColor: "#FF8C01", sBgColor: "#FFFFFF", sWmode: "transparent" }));
        sIFR.replaceElement(named({ sSelector: "h1.itemTitle", sFlashSrc: applyProtocol + "www.stedentrips.nl/flash/eurostile_bold.swf", sColor: "#000000", sBgColor: "#FFFFFF", sWmode: "transparent" }));
        sIFR.replaceElement(named({ sSelector: "h2.itemTitle", sFlashSrc: applyProtocol + "www.stedentrips.nl/flash/eurostile_bold.swf", sColor: "#000000", sBgColor: "#FFFFFF", sWmode: "transparent" }));
        sIFR.replaceElement(named({ sSelector: "h1.itemTitleOrange", sFlashSrc: applyProtocol + "www.stedentrips.nl/flash/eurostile_bold.swf", sColor: "#FF8C01", sBgColor: "#FFFFFF", sWmode: "transparent" }));
        //sIFR.replaceElement(named({sSelector:"em.itemTitle", sFlashSrc:"/flash/eurostile_bold.swf", sColor:"#FF8C01", sBgColor:"#FFFFFF"}));
        sIFR.replaceElement(named({ sSelector: "h1.top15Label", sFlashSrc: applyProtocol + "www.stedentrips.nl/flash/eurostile_bold.swf", sColor: "#000000", sBgColor: "#FF8C01", sWmode: "transparent" }));
        sIFR.replaceElement(named({ sSelector: "h3.availTitle", sFlashSrc: applyProtocol + "www.stedentrips.nl/flash/eurostile_bold.swf", sColor: "#000000", sBgColor: "#FFFFFF", sWmode: "transparent" }));
        sIFR.replaceElement(named({ sSelector: "h2.pageTitle", sFlashSrc: applyProtocol + "www.stedentrips.nl/flash/eurostile_bold.swf", sColor: "#000000", sBgColor: "#FFFFFF", sWmode: "transparent" }));
        sIFR.replaceElement(named({ sSelector: "h2.hotelTitle", sFlashSrc: applyProtocol + "www.stedentrips.nl/flash/eurostile_bold.swf", sColor: "#000000", sBgColor: "#FFFFFF", sWmode: "transparent" }));
        sIFR.replaceElement(named({ sSelector: "h2.smallTitle", sFlashSrc: applyProtocol + "www.stedentrips.nl/flash/eurostile_bold.swf", sColor: "#857663", sBgColor: "#FFFFFF", sWmode: "transparent" }));
        //sIFR.replaceElement(named({sSelector:"h3.tabTitle", sFlashSrc:"/flash/eurostile_bold.swf", sColor:"#000000", sBgColor:"#FFFFFF"}));
    };
}

function closePopup()
{
    screenOverlay(false);
    
    gO('showPanel').innerHTML='';
    getStyle('showPanel').display='none';
}

function showAction(msg, xcoor)
{
    var arrow = getStyle('actionArrow');
    arrow.right=parseFloat(xcoor)+'px';
    gO('actionDesc').innerText=msg;

    getStyle('actionPopup').display='inline';
    arrow.display='inline';
    getStyle('actionDesc').display='inline';
}

function hideAction()
{
    getStyle('actionPopup').display='none';
    getStyle('actionArrow').display='none';
    getStyle('actionDesc').display='none';
}

function restrictDDoptions()
{
    var depOptions=gO(departureID); 
    var destOptions=gO(destinationID); 
    
    var optieParts = new Array(); 
    optieParts = ddOptions.split('|');
    
    while (destOptions.length>1)
    {
        destOptions.remove(1);
    }
    
    for (i=0; i<optieParts.length; i++)
    {
        if (optieParts[i].substr(0,3)==depOptions.value)
        {
            var newOption = document.createElement('option');
            newOption.value=optieParts[i].substr(3,3);
            newOption.label=ddDesc[optieParts[i].substr(3,3)];
            //newOption.text=ddDesc[optieParts[i].substr(3,3)];
            //destOptions.appendChild(newOption);
            addDDitem(destOptions, newOption);
        }
    }
}

function selectedTransport()
{
    if (gO(tpID))
    {
        var rV = gO(tpID).getElementsByTagName('input');
        
        for (i=0; i<rV.length; i++)
        {
            if (rV[i].checked)
            {
                return parseInt(rV[i].value);
            }
        }
    }
    
    return 11;
}

function checkPackage()
{
    var errMsg = new Object();

    errMsg.message='';

    if (formHeen.value=='' && errMsg.message=='') { errMsg.message = 'Selecteer een vertrekdatum'; errId=999; }
    if (formTerug.value=='' && errMsg.message=='') { errMsg.message = 'Selecteer een datum van terugkomst'; errId=998; }
    
    var numRooms = 0;
    
//    for (i=0; i<3; i++)
//    {
//        if (getStyle('rowK'+(i+1).toString()).display!='none')
//        {
//            if (gO(roomObj[i][0]))
//            {
//                if (parseInt(gO(roomObj[i][0]).value)>0)
//                {
//                    numRooms += parseInt(gO(roomObj[i][0]).value);
//                }                
//            }
//        }
//    }

    if (formTransport>11)
    {
        var objDep = gO(departureID);
        var objDst = gO(destinationID);    
        
        switch(parseInt(formTransport))
        {
            case 13:
                if (objDst[objDst.selectedIndex].value=='0') { errMsg.message='Selecteer een aankomst station'; }
                if (objDep[objDep.selectedIndex].value=='0') { errMsg.message='Selecteer een vertrek station'; }
            break;
            
            case 14:
                if (objDst[objDst.selectedIndex].value=='0') { errMsg.message='Selecteer een aankomst haven'; }
                if (objDep[objDep.selectedIndex].value=='0') { errMsg.message='Selecteer een vertrek haven'; }
            break;
            
            default:
                if (objDst[objDst.selectedIndex].value=='0') { errMsg.message='Selecteer een aankomst luchthaven'; }
                if (objDep[objDep.selectedIndex].value=='0') { errMsg.message='Selecteer een vertrek luchthaven'; }
            break;                        
        }
    }


    //formVolw formVolw[formVolw.selectedIndex].value
    //formKind 
    //formBaby 

    //roomObj

    //formTransport

    //departureID
    //destinationID    
    return errMsg;
}

function roomStr()
{
    var retval = '';

    var allDD = new Array();
    allDD = document.getElementsByTagName('select');

    for (i = 0; i < allDD.length; i++) {
        if (allDD[i].id.indexOf('HUC') > -1) {
            if (parseInt(allDD[i][allDD[i].selectedIndex].value) > 0) {
                var tmpstr = allDD[i].id.substr(allDD[i].id.indexOf('HUC') + 4);
                var huc = tmpstr.substr(0, tmpstr.indexOf('_'));

                retval += huc + ':' + allDD[i][allDD[i].selectedIndex].value + '|'
            }
        }
    }

//    for (i=0; i<3; i++)
//    {
//        if (getStyle('rowK'+(i+1).toString()).display!='none')
//        {
//            if (gO(roomObj[i][0]))
//            {
//                if (parseInt(gO(roomObj[i][0]).value)>0)
//                {
//                    retval += gO(roomObj[i][1]).value +':'+ gO(roomObj[i][0]).value + '|';
//                }                
//            }
//        }
//    }
    
    retval = retval.substr(0,retval.length-1);
    
    return retval;
}

function myBoard()
{
    var retval = '';
    
    if (formBoard.selectedIndex)
    {
        retval = formBoard[formBoard.selectedIndex].value
    } else {
        retval = formBoard.value;
    }
    
    return retval;
}

function jsFlash(id, src, style, align, width, height, param) {
    var alignstr = '';
    if (align != '') {
        alignstr = 'align="' + align + '" ';
    }

    var stylestr = '';
    if (style != '') {
        stylestr = 'style="' + style + '" ';
    }

    var retstr = '';

    retstr = retstr + '<object type="application/x-shockwave-flash" ' + alignstr + 'width="' + width + '" ' + stylestr + 'height="' + height + '" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">';
    retstr = retstr + '<param name="movie" value="' + src + '" />';
    retstr = retstr + param;

    retstr = retstr + '<object type="application/x-shockwave-flash" ' + alignstr + 'id="' + id + '" data="' + src + '" width="' + width + '" height="' + height + '">';
    retstr = retstr + param;
    retstr = retstr + '</object>';

    retstr = retstr + '</object>';

    return retstr;
}

function tPp(force)
{
    if (doneLoading)
    {
        if (getStyle('zbContainer').display=='none')
        {
            toggleTo('reisplan');
        }
    
        var errorMsg = checkPackage();
        if (errorMsg.message=='')
        {
            var packObj = getStyle('prijsContainer');
            
            if (packObj.display=='none' || force)
            {
                packObj.display='inline';
                gO('prijsContents').innerHTML='<div style="width: 100%; padding-top: 40px; text-align: center">';
                gO('prijsContents').innerHTML=gO('prijsContents').innerHTML+jsFlash('', '/flash/wait_steden.swf', 'cursor: pointer', 'middle', '100', '100', '<param name="wmode" value="transparent" />');
                gO('prijsContents').innerHTML=gO('prijsContents').innerHTML+'<br/><span style="font-size: 10px; color: #857663">Pakketprijs<br/>wordt opgevraagd</span></div>';
                gO('groenRond').style.display = 'none';

                var objDep = gO(departureID);
                var objDst = gO(destinationID);

                Ajax_Code.calculatePrice(formVolw[formVolw.selectedIndex].value, formKind[formKind.selectedIndex].value, formBaby[formBaby.selectedIndex].value, formHeen.value, formTerug.value, roomStr(), formTransport, objDep[objDep.selectedIndex].value, objDst[objDst.selectedIndex].value, hotelid, myBoard(), SucceededCallback, FailedCallback);
            } else {
                packObj.display='none';
            }
        } else {
            alert(errorMsg.message);
        }    
    } else {
        Ajax_Code.showPrice(SucceededCallback, FailedCallback);    
    }
}

function toggleOverlay(show)
{
    var overObj = getStyle('screenOverlay');
    
    if (show)
    {
        overObj.width=PageScrollWidth().toString()+'px';
        overObj.height = PageScrollHeight().toString() + 'px';
        overObj.display='inline';

        //hidePersistent();
    } else {
        overObj.display='none';

        //showPersistent();
    }    
}

function showPopup(width, height, HTML)
{
    toggleOverlay(true);
    
    var myPanel=gO('showPanel');
    var myStyle=getStyle('showPanel');
    
    myStyle.display='inline';
    myStyle.width=width.toString()+'px';
    myStyle.height=height.toString()+'px';
    myStyle.left=((parseInt(BrowserWidth()) / 2)-(width/2)).toString()+'px';
    myStyle.top=((parseInt(BrowserHeight()) / 2)-(height/2)+parseInt(PageScrollY())).toString()+'px';
    
    myPanel.innerHTML = HTML;
}


function hidePopup()
{
    toggleOverlay(false);
    
    getStyle('showPanel').display='none';
}

function showExtraPanel(anchorObj, flightid)
{
    var myflight = gO(flightid);
    
    if (!myflight.disabled)
    {
         var tmpFlight = flightExtra[flightid];
        var extraPanel;
        
        //var extraLeft = 0;
        
        if (tmpFlight.richting=='inbound') { extraPanel=gO('extraInbound'); } else { extraPanel=gO('extraOutbound'); }
        
        extraPanel.style.display='inline';
        extraPanel.style.width = (anchorObj.parentNode.offsetWidth).toString() + 'px';
        extraPanel.style.top = (anchorObj.parentNode.offsetTop + anchorObj.parentNode.offsetHeight-2).toString() + 'px';
        //extraPanel.style.left = (extraLeft + anchorObj.parentNode.offsetLeft).toString() + 'px';
        
        var extraHTML = '<div style="border-bottom: solid 5px #FF8C01; background-color: #FFFFFF"><table cellpadding="0" width="'+(anchorObj.parentNode.offsetWidth).toString()+'px" cellspacing="0"><tr><td class="'+tmpFlight.ratecls+'" style="width: 26px"><div class="checkCell">&nbsp;</div></td><td class="'+tmpFlight.ratecls+'_border" style="padding-left: 8px; padding-bottom: 4px; border-top: solid 1px #666666">';
        var codeCells='<td></td><td></td>';
        if (tmpFlight.codeshare!='')
        {
            codeCells='<td><b>Codeshare:</b></td><td>'+tmpFlight.codeshare+'</td>';
        }
        extraHTML = extraHTML + '<table style="table-layout: fixed; width: 316px; margin-top: 6px; margin-bottom: 2px" cellpadding="0" cellspacing="0"><tr><td><b>Maatschappij:</b></td><td>&nbsp;' + tmpFlight.carriername + '</td><td><b>';
        if (tmpFlight.beneklasse == "0") {
            extraHTML = extraHTML + 'Vluchtnummer:';
        } else {
            extraHTML = extraHTML + 'Treinnummer:';
        }
        
        extraHTML = extraHTML + '</b></td><td>&nbsp;' + tmpFlight.flightnr + '</td></tr><tr><td><b>Klasse:</b></td><td>&nbsp;' + tmpFlight.klasse + '</td>' + codeCells + '</tr></table>';
        extraHTML = extraHTML + '</td></tr></table></div>';
        
        extraPanel.innerHTML = extraHTML;
        
        if (gO('over_'+flightid)) { gO('over_'+flightid).style.display='none'; }    
    }
    
    //alert(anchorObj.style.top);
}

function hideExtraPanel(flightid)
{
    gO('extraOutbound').style.display='none';
    gO('extraInbound').style.display='none';
    
    if (flightid!='') { if (gO(flightid).disabled) { gO('over_'+flightid).style.display='inline'; }}
}

function lightFlight(myobj, col, tmpid)
{
    var divs = myobj.getElementsByTagName('div');
    
    for (t=0; t<divs.length; t++)
    {
        if (divs[t].className=='routeDiv')
        {
            var flightid=divs[t].getAttribute('flightid');
            var flightobj=gO(flightid);
            
            if (!flightobj.disabled)
            {
                if (col)
                {
                    //divs[t].style.backgroundColor='#FF8C01';
                    divs[t].style.fontWeight='bold';
                    divs[t].style.cursor='pointer';
                    showExtraPanel(myobj, flightid);
                } else {
                    //divs[t].style.backgroundColor='';
                    divs[t].style.fontWeight='normal';
                    divs[t].style.cursor='default';
                    hideExtraPanel(flightid);
                }
            }
        }
    }
}

function recalcSupplement(refreshprice)
{
    if (refreshprice)
    {
        if (selFlights['outbound'] && selFlights['inbound'])
        {
            gO('totaalPrijs').innerHTML='<img style="float: right; margin-top: 8px; margin-right: 8px; margin-bottom: 2px" src="/App_Image/waiting.gif" alt="Prijs wordt opgevraagd" />';
            Ajax_Code.updateFlightPrice(selFlights['outbound'].id, selFlights['inbound'].id, SucceededCallback, FailedCallback);
        }
//        if (priceObj)
//        {
//            if (flightobj)
//            {
//                //todo misschien iets met res systeem totaal supplement?
//                var selectedVlucht = selFlights[flightobj.richting];
//                
//                if (selectedVlucht) {
//                    //als er niks geselecteerd is, kan je ook het verschil niet berekenen
//                    var priceSup = parseFloat(selectedVlucht.supplement.replace(",", ".")) * parseInt(priceObj.aantalpers);
//                    var flightSup = parseFloat(flightobj.supplement.replace(",", ".")) * parseInt(priceObj.aantalpers);
//                    
//                    //var oldPrice = parseFloat(gO('totaalPrijs').innerHTML.replace(",", "."));
//                    
//                    gO('totaalPrijs').innerHTML='<img style="float: right; margin-top: 8px; margin-right: 8px" src="/App_Image/waiting.gif" alt="Prijs wordt opgevraagd" />';
//                }
//            }
//        }
    }
}

function mndname(mndnum)
{
    var mndval;
    
    switch(mndnum)
    {
        case 1:
            mndval='Januari';
        break;
        case 2:
            mndval='Februari';
        break;
        case 3:
            mndval='Maart';
        break;
        case 4:
            mndval='April';
        break;
        case 5:
            mndval='Mei';
        break;
        case 6:
            mndval='Juni';
        break;
        case 7:
            mndval='Juli';
        break;
        case 8:
            mndval='Augustus';
        break;
        case 9:
            mndval='September';
        break;
        case 10:
            mndval='Oktober';
        break;
        case 11:
            mndval='November';
        break;
        case 12:
            mndval='December';
        break;
   }
   
   return mndval;
}

function formatDate(datestr)
{
    var dateparts = new Array();
    dateparts = datestr.split('-');
    
    var dag = dateparts[2];
    var mnd = dateparts[1];
    
    while (dag.substr(0,1)=='0')
    {
        dag = dag.substr(1);
    }

    while (mnd.substr(0,1)=='0')
    {
        mnd = mnd.substr(1);
    }
    
    if (dateparts.length>0)
    {
        return parseInt(dag).toString()+' '+mndname(parseInt(mnd)).toLowerCase()+' '+dateparts[0];
    }
    
    return '';
}

function formatnum(mydec, format)
{
    var mystr = mydec.toString();
    
    if (mystr.indexOf('.')>-1)
    {
        var mysplit = mystr.split('.');
        
        var mysmall = mysplit[1];
        if (parseInt(mysmall)<10)
        {
            mysmall = mysmall+'0';
        }
        
        return mysplit[0]+','+mysmall;
        
    } else {
        return mystr;    
    }
}

function updateReisplan(myflight)
{
    var timeObj=gO('tijd_'+myflight.richting);
    var picObj=gO('carrier_'+myflight.richting);
    var routeObj=gO('routing_'+myflight.richting);
    
    if (timeObj) { timeObj.innerHTML=myflight.deptime; }
    if (routeObj) { routeObj.innerHTML = myflight.route; }
    if (picObj) {
        picObj.src = '/App_Image/icon/transport/' + myflight.carrierid + '.png';
        picObj.alt = myflight.carriername;
    }
}

function selectFlight(myid, refreshprice)
{
    if (myid!='')
    {
        if (!gO(myid).disabled)
        {
            selFlights[flightExtra[myid].richting]=flightExtra[myid];

            updateReisplan(flightExtra[myid]);
            
            if (flightExtra[myid].richting=='outbound')
            {
                setOut(myid);
            } else {
                setIn(myid);
            }
         
            gO(myid).checked = true;
            
            if (flightExtra[myid].richting=='outbound') { markAllowed(myid); }
            
            recalcSupplement(refreshprice);
        }   
    }
}

function flightRow(flightObj, selectedflight)
{
    flightExtra[flightObj.id] = flightObj;

    var retVal ='<tr><td style="padding-bottom: 1px; padding-top: 1px; border-bottom: solid 1px #666666"><div style="width: 350px; overflow: hidden; position: relative" onclick="javascript:selectFlight(\''+flightObj.id+'\', true);" onmouseover="javascript:lightFlight(this, true, \''+flightObj.id+'\'); " onmouseout="javascript:lightFlight(this, false, \''+flightObj.id+'\'); "><table style="width: 350px" cellpadding="0" cellspacing="0">';
    
    var hidePanelHeight = 32;

    if (flightObj.via!='')
    {
        retVal += '<tr>';
        retVal += '<td class="'+flightObj.ratecls+'" width="26px"><div class="checkCell"><input type="radio" id="'+flightObj.id+'" name="'+flightObj.richting+'" value="'+flightObj.id+'" /></div></td>'
        retVal += '<td class="routeCell"><div class="routeDiv" flightid="'+flightObj.id+'">'+flightObj.dep+'<br />via&nbsp;'+flightObj.via+'<br />'+flightObj.dst+'</div></td>';
        retVal += '<td class="timeCell"><div class="timeDiv">'+flightObj.deptime+'<br />'+flightObj.viatime+'<br />'+flightObj.dsttime+'</div></td>';
        hidePanelHeight = 42;
    } else {
        retVal += '<tr>';
        retVal += '<td class="'+flightObj.ratecls+'" width="26px"><div class="checkCell"><input type="radio" id="'+flightObj.id+'" name="'+flightObj.richting+'" value="'+flightObj.id+'" /></div></td>'
        retVal += '<td class="routeCell">';
        if (flightObj.beneklasse != "0") {
            retVal += '<img style="float: left; margin-right: 3px; margin-top: 2px" src="/App_Image/icon/klasse_' + flightObj.beneklasse.toString() + '.png" alt="Klasse trein" />';
        }
        retVal += '<div class="routeDiv" ';
        if (flightObj.beneklasse != "0") {
            retVal += 'style="width: 150px" ';
        }
        retVal += 'flightid="' + flightObj.id + '">' + flightObj.dep + '<br />' + flightObj.dst + '</div></td>';
        retVal += '<td class="timeCell"><div class="timeDiv">'+flightObj.deptime+'<br />'+flightObj.dsttime+'</div></td>';
        hidePanelHeight = 32;
    }
    
    var flightSub = '';
    
    if (flightObj.flightnr.length>=4)
    {
        flightSub=flightObj.flightnr.substr(0,4);
    }
   
    if (flightObj.flightnr!='STENA')
    {
        if (flightSub!='EURO') {
            if (flightSub != 'THAL') {
                retVal += '<td class="flightCell"><div class="flightDiv">' + flightObj.flightnr.substr(0, 2) + '<br />' + flightObj.flightnr.substr(2) + '</div></td>';
            } else {
                retVal += '<td class="flightCell"><div class="flightDiv">' + flightObj.flightnr.substr(0, 4) + '<br />' + flightObj.flightnr.substr(4) + '</div></td>';
            }
        } else {
            retVal += '<td class="flightCell"><div class="flightDiv">'+flightObj.flightnr.substr(0,4)+'<br />'+flightObj.flightnr.substr(4)+'</div></td>';
        }
    } else {
        retVal += '<td class="flightCell"><div class="flightDiv" style="font-size: 10px; width: 50px">'+flightObj.flightnr+'</div></td>';
    }
    
    retVal += '<td class="infoCell"><div class="infoDiv"><img src="/App_Image/icon/transport/'+flightObj.carrierid+'.png" alt="'+flightObj.carriername+' vlucht '+flightObj.flightnr+'" /></div></td>';
    retVal += '</tr>';
    retVal += '</table>';
    
    if (flightObj.richting=='inbound')
    {
        retVal += '<div id="over_'+flightObj.id+'" flightid="'+flightObj.id+'" style="display: inline; position: absolute; left: 27px; top: 0px; filter: alpha(opacity=70); opacity: 0.7; background-color: #FFFFFF; height: '+hidePanelHeight.toString()+'px; width: 323px" panelheight="'+hidePanelHeight.toString()+'px">&nbsp;</div>';
    }
    
    retVal += '</td></tr>';
    
    return retVal;
}
    
function flightCol(flightsObj, selectedflight, outbound)
{
    var retVal ='';
    
    if (outbound)
    {
        retVal='<div style="width: 350px; overflow: hidden; position: relative; padding-bottom: 45px"><table style="width: 350px" cellpadding="0" cellspacing="1">';
    } else {
        retVal='<div style="width: 350px; overflow: hidden; position: relative; padding-bottom: 45px"><table id="inboundTable" style="width: 350px" cellpadding="0" cellspacing="1">';
    }
    
    for (i=0; i<flightsObj.length; i++)
    {
        retVal += flightRow(flightsObj[i], selectedflight);
    }
                        
    retVal += '</table>';
    
    if (outbound)
    {
        retVal += '<div id="extraOutbound" style="display: none; position: absolute; left: 0px; background-color: #FFFFFF; font-size: 10px"></div>';
    } else {
        retVal += '<div id="extraInbound" style="display: none; position: absolute; background-color: #FF0000; font-size: 10px"></div>';
    }
    
    retVal += '</div>';
    
    //selFlights['outbound']
    
    return retVal;
}

function markAllowed(outID)
{
    resetAllowed();
    
    for (i=0; i<combos[outID].length; i++)
    {
        var overPanel = gO('over_'+combos[outID][i]);
        
        overPanel.style.width='0px';
        overPanel.style.height='0px';
        
        gO(combos[outID][i]).disabled=false;
    }
    
    checkAllowed();
}

function checkAllowed()
{
    var tableobj = gO('inboundTable');
    
    var rowObj;
    
    if (tableobj.tBodies)
    {
        if (tableobj.tBodies.length==0)
        {
            rowObj = tableobj;
        } else {
            rowObj = tableobj.tBodies[0];
        }
    } else {
        rowObj = tableobj;
    }
    
    var selectNextBest = false;
    
    for (i=0; i<rowObj.rows.length; i++)
    {
        var allPanels = rowObj.rows[i].getElementsByTagName('div');

        for (j=0; j<allPanels.length; j++)
        {
            if (allPanels[j].id!='')
            {
                if (allPanels[j].style.width!='0px')
                {
                    var allInput = rowObj.rows[i].getElementsByTagName('input');
                    
                    for (k=0; k<allInput.length; k++)
                    {
                        if (allInput[k].checked) { 
                            allInput[k].checked=false; 
                            selFlights['inbound']=null; 
                            selectNextBest=true;
                            allPanels[j].style.display='inline';
                        }
                    }
                }
            }
        }      
    }
    
    if (selectNextBest) 
    {
        //TODO cheapest
       
        for (i=0; i<rowObj.rows.length; i++)
        {
            var transPanels = rowObj.rows[i].getElementsByTagName('div');

            for (j=0; j<transPanels.length; j++)
            {
                if (transPanels[j].id!='')
                {
                    var transInput = rowObj.rows[i].getElementsByTagName('input');
                    
                    for (k=0; k<transInput.length; k++)
                    {
                        if (!transInput[k].disabled) 
                        {  
                            transInput[k].click();
                            return true;
                        }
                    }
                }
            }      
        }        
    }
}

function resetAllowed()
{
    var tableobj = gO('inboundTable');
    
    var rowObj;
    
    if (tableobj.tBodies)
    {
        if (tableobj.tBodies.length==0)
        {
            rowObj = tableobj;
        } else {
            rowObj = tableobj.tBodies[0];
        }
    } else {
        rowObj = tableobj;
    }
    
    for (i=0; i<rowObj.rows.length; i++)
    {
        var allPanels = rowObj.rows[i].getElementsByTagName('div');

        for (j=0; j<allPanels.length; j++)
        {
            if (allPanels[j].id!='')
            {
                allPanels[j].style.width='350px';
                allPanels[j].style.height=allPanels[j].getAttribute('panelheight');
                gO(allPanels[j].id.substr(5)).disabled=true;
            }
        }      
    }
}

function updateTransportTimes(heencol, terugcol, heenselect, terugselect, introtxt, tmprates, bene)
{
    var rates = new Array();
    rates = tmprates.split(";");
    while (rates.length<5)
    {
        rates.push('0');
    }

    var changeHTML = '<div style="width: 730px; padding: 0px 6px 0px 6px"><img src="/App_Image/terug_reisplan.png" style="" alt="Terug naar reisplan" /><div style="margin-top: 2px">' + introtxt;

    if (bene) {
        changeHTML = changeHTML + '<div style="float: right; width: 520px; text-align: right; font-size: 12px; margin-right: 10px; margin-bottom: 8px; position: relative"><img style="vertical-align: middle; margin-right: 8px" src="/App_Image/icon/klasse_2a.png" alt="2e klasse actietarief">2e klasse actietarief<img style="margin-left: 30px; vertical-align: middle; margin-right: 8px" src="/App_Image/icon/klasse_1a.png" alt="1e klasse actietarief">1e klasse actietarief<img style="vertical-align: middle; margin-left: 30px; margin-right: 8px" src="/App_Image/icon/klasse_2.png" alt="2e klasse">2e klasse<img style="margin-left: 30px; margin-right: 8px; vertical-align: middle" src="/App_Image/icon/klasse_1.png" alt="1e klasse">1e klasse</div>';
    } else {
        changeHTML = changeHTML + '<div style="float: right; width: 270px; text-align: right; font-size: 10px; margin-right: 10px; position: relative"><table cellpadding="0" cellspacing="0"><tr><td><b>Tarief:</b>&nbsp;laag&nbsp;&nbsp;</td><td><div class="rateBox0">&nbsp;</div></td><td><div class="rateBox1">&nbsp;</div></td><td><div class="rateBox2">&nbsp;</div></td><td><div class="rateBox3">&nbsp;</div></td><td><div class="rateBox4">&nbsp;</div></td><td><div class="rateBox5">&nbsp;</div></td><td>&nbsp; hoog</td></tr></table><div style="position: absolute; left: 47px; top: 0px"><table cellpadding="0" cellspacing="0"><tr><td><div style="width: 27px"></div></td><td><div style="width: 27px; text-align: center">' + rates[0] + '</div></td><td><div style="width: 27px; text-align: center">' + rates[1] + '</div></td><td><div style="width: 27px; text-align: center">' + rates[2] + '</div></td><td><div style="width: 27px; text-align: center">' + rates[3] + '</div></td><td><div style="width: 27px; text-align: center">' + rates[4] + '</div></td></tr></table></div></div>';
    }
        
    changeHTML = changeHTML + '<table style="width: 721px" cellpadding="0" cellspacing="0"><tr><td style="width: 350px; vertical-align: top; padding-right: 8px; border-right: solid 3px #857663"><img style="margin-bottom: 4px" src="/App_Image/heenreis.png" alt="Heenreis" />';
    changeHTML += flightCol(heencol, heenselect, true);
    changeHTML += '</td><td style="width: 350px; vertical-align: top; padding-left: 8px"><img style="margin-bottom: 4px" src="/App_Image/terugreis.png" alt="Terugreis" />';
    changeHTML += flightCol(terugcol, terugselect, false);
    changeHTML += '</td></tr></table></div></div>';
    gO('transContainer').innerHTML=changeHTML;

    selectFlight(heenselect, false);
    selectFlight(terugselect, false);
    
    markAllowed(heenselect);
}

function setMainImage(myurl)
{
    mainImgObj.src=myurl;
}

var infobr;
function getinfobar() {
    if (infobr == null) {
        infobr = gO(infobarid);
    }

    return infobr;
}

var showbr;
function getshowbar() {
    if (showbr == null) {
        showbr = gO(showbarid);
    }

    return showbr;
}

function initInfoBar() {
    var cookieval = getCookie('infobar');

    if ((cookieval==undefined) || (cookieval == 'true')) {
        window.onscroll = function () {
            var val = PageScrollY();

            var infobar = getinfobar();

            if (val > 40) {
                //if (getshowbar().style.display != 'none') { getshowbar().style.display = 'none'; }

                if (infobar != null) {
                    //infobar.style.top = (val - 1).toString() + 'px';
                    if (infobar.style.display == 'none') {
                        infobar.style.top = '-36px';
                        infobar.style.display = 'block';
                        ibTO = setTimeout(smoothInfoBar, 10);
                    }
                }
            } else {
                if (infobar != null) {
                    if (infobar.style.display == 'block') {
                        ibHO = setTimeout(smoothHideBar, 10);
                    }
                }
            }
        }
    } else if (cookieval == 'always') {
        var infobar = getinfobar();
        gO('lockbar').src = '/App_Image/bar/padlock_closed.png';
        infobar.style.display = 'block';
    }
}

function lockOver(callobj) {
    if (callobj.src.indexOf('_open') > -1) {
        callobj.src = '/App_Image/bar/padlock_open_over.png';
    } else {
        callobj.src = '/App_Image/bar/padlock_closed_over.png';
    }
}

function lockOut(callobj) {
    if (callobj.src.indexOf('_open') > -1) {
        callobj.src = '/App_Image/bar/padlock_open.png';
    } else {
        callobj.src = '/App_Image/bar/padlock_closed.png';
    }
}

function lockInfoBar(callobj) {
    if (callobj.src.indexOf('_open') > -1) {
        callobj.src = '/App_Image/bar/padlock_closed_over.png';
        
        forceInfoBar();
    } else {
        callobj.src = '/App_Image/bar/padlock_open_over.png';
        setCookie('infobar', 'true', 90);
    }
}

function forceInfoBar() {
    setCookie('infobar', 'always', 90);
    showInfoBar();
}

function showInfoBar() {
    var cookieval = getCookie('infobar');

    if (cookieval == 'true') {
        window.onscroll = function () {
            var val = PageScrollY();

            var infobar = getinfobar();

            if (val > 40) {
                //if (getshowbar().style.display != 'none') { getshowbar().style.display = 'none'; }

                if (infobar != null) {
                    //infobar.style.top = (val - 1).toString() + 'px';
                    if (infobar.style.display == 'none') {
                        infobar.style.top = '-36px';
                        infobar.style.display = 'block';
                        ibTO = setTimeout(smoothInfoBar, 10);
                    }
                }
            } else {
                //if (getshowbar().style.display != 'block') { getshowbar().style.display = 'block'; }

                if (infobar != null) {
                    if (infobar.style.display == 'block') {
                        ibHO = setTimeout(smoothHideBar, 10);
                    }
                }
            }
        }
    } else if (cookieval == 'always') {
        window.onscroll = function () { }
    }

    getshowbar().style.display = 'none';

    getinfobar().style.display = 'block';

    smoothInfoBar();
}

function hideInfoBar() {
    window.onscroll = function () {

    }

    ibSO = setTimeout(showInfoControl, 160);

    smoothHideBar();

    setCookie('infobar', 'false', 90);
}

var ibTO;
var ibHO;
var ibSO;

function showInfoControl()
{
    getshowbar().style.display = 'block';
}

function smoothInfoBar() {
    var infobar = getinfobar();

    if (infobar != null) {
        var infotop = parseInt(infobar.style.top);

        if (infotop < 0) {
            infotop = infotop + 6;

            if (infotop > 0) { infotop = 0; }

            infobar.style.top = infotop.toString() + 'px';

            if (infotop < 0) {
                ibTO = setTimeout(smoothInfoBar, 40);
            }
        }
    }
}

function smoothHideBar() {
    if (getshowbar().style.display != 'block') { getshowbar().style.display = 'block'; }

    var infobar = getinfobar();

    if (infobar != null) {
        var infotop = parseInt(infobar.style.top);

        if (infotop > -36) {
            infotop = infotop - 6;

            if (infotop < -36) { infotop = -36; }

            infobar.style.top = infotop.toString() + 'px';

            if (infotop > -36) {
                ibHO = setTimeout(smoothHideBar, 10);
            } else {
                infobar.style.display = 'none';
            }
        }
    }

}

function fScrollTo(val)
{
    window.scrollTo(0,val);
}

function udTO()
{
    var transLbl = gO('transportTabLbl');

    if (transLbl)
    {
        var myradios = document.getElementsByName("transportOptions");
        
        for (radidx=0; radidx<myradios.length; radidx++)
        {
            if (myradios[radidx].checked)
            {
                formTransport = myradios[radidx].value;

                if (formTransport == '11') {
                    gO('tabTransport').style.display = 'none';
                    gO(departureID).style.display = 'none';
                    gO(destinationID).style.display = 'none';
                    gO('fromLbl').style.display = 'none';
                    gO('toLbl').style.display = 'none';
                } else {
                    Ajax_Code.loadDepDest(transportstad, myradios[radidx].value, SucceededCallback, FailedCallback);
                }
            }
        }
    
        switch (formTransport)
        {
            case '13':
                transLbl.innerHTML = 'Treinopties'; 
            break;

            case '14':
                transLbl.innerHTML = 'Bootopties'; 
            break;
                    
            default:
                transLbl.innerHTML = 'Vluchtopties'; 
            break;
        }
        
        reisplanChanged();
    }
}

function addRoom()
{
    var row1 = gO('rowK1');
    var row2 = gO('rowK2');
    var row3 = gO('rowK3');
    
    var kamers1 = gO('kamers1');
    var kamers2 = gO('kamers2');
    var kamers3 = gO('kamers3');
    
    var chosenRooms = new Array();
    
    if (row2.style.display=='none')
    {
        chosenRooms.push(kamers1.options[kamers1.selectedIndex].value);
        row2.style.display='inline';
        
        redoRooms(kamers2, chosenRooms);        
    } else {
        chosenRooms.push(kamers1.options[kamers1.selectedIndex].value);
        if (row2.style.display!='none') { chosenRooms.push(kamers2.options[kamers2.selectedIndex].value); }
        
        row3.style.display='inline';
        
        redoRooms(kamers3, chosenRooms);        
        
        getStyle('rowAdd').display='none';
    }
    
    checkRoomOptions();
}

function removeRoom(myobj)
{
    var applicID = myobj.id.substr(myobj.id.length-1);
    
    if (applicID=='2' && getStyle('rowK3').display!='none')
    {
        // Row 2 = Row 3
        gO(eval('numRoom2')+"_currentDD").value=gO(eval('numRoom3')+"_currentDD").value;
        gO('kamers2').value=gO('kamers3').value;
        
        applicID=3;
    } 
      
    var rowObj = gO('rowK'+applicID);
    gO(eval('numRoom'+applicID)+"_currentDD").value=0;
    getStyle('rowK'+applicID).display='none';
    getStyle('rowAdd').display='inline';
    
    checkRoomOptions();
}

function redoRooms(applicroom, chosenRooms)
{
    for (i=applicroom.options.length; i>0; i--)
    {
        applicroom.remove(0);
    }
    
    for (i=0; i<availableRooms.length; i++)
    {
        var inArray = false;
        
        for (csnRoom in chosenRooms)
        {
            if (availableRooms[i]==chosenRooms[csnRoom]) { inArray=true; }
        }    
        
        if (!inArray)
        {
            var newOption = document.createElement('option');
            newOption.value=availableRooms[i].toString();
            newOption.label=availableRooms[i].substr(availableRooms[i].indexOf('~')+1).toString()+'-persoonskamer';

            addDDitem(applicroom, newOption);
        }
    }
}

function checkRoomOptions()
{
    var row1 = gO('rowK1');
    var row2 = gO('rowK2');
    var row3 = gO('rowK3');
    
    var kamers1 = gO('kamers1');
    var kamers2 = gO('kamers2');
    var kamers3 = gO('kamers3');
    
    if (row2.style.display!='none')
    {
        // Row2 zichtbaar
        if (row3.style.display!='none')
        {
            // Row3 zichtbaar
            kamers1.disabled=true;
            kamers2.disabled=true;
            kamers3.disabled=false;
        } else {
            // Row3 niet zichtbaar 
            kamers1.disabled=true;
            kamers2.disabled=false;
            //kamers3.disabled=true;
        }
    } else {
        // Row2 niet zichtbaar
        if (row3.style.display!='none')
        {
            // Row3 zichtbaar
            kamers1.disabled=true;
            //kamers2.disabled=true;
            kamers3.disabled=false;
        } else {
            // Row3 niet zichtbaar 
            kamers1.disabled=false;
        }
    }
}

function toggleTo(togwhere)
{
    var transCont = gO('transContainer');
    var kamerCont = gO('kamerContainer');
    var planCont = gO('zbContainer');
    var offerCont = gO('offerContainer');

    var transBut = gO('tabTransport');
    var kamerBut = gO('tabKamers');
    var planBut = gO('tabReisplan');
    var offerBut = gO('tabOffers');

    var noInit = false;

    if (togwhere == 'transportnoinit') {
        togwhere = 'transport';
        noInit = true;
    }

    transCont.style.display = 'none';
    planCont.style.display = 'none';
    offerCont.style.display = 'none';
    kamerCont.style.display = 'none';

    transBut.className = 'availTabinActive';
    planBut.className = 'availTabinActive';
    kamerBut.className = 'availTabinActive';
    offerBut.className = 'availTabinActive';

    switch (togwhere)
    {
        case 'offers':
            if (offerCont.style.display != 'inline') {
                offerCont.style.display = 'inline';
                offerBut.className = 'availTabActive';
            }
        break;

        case 'transport':
            if (transCont.display != 'inline') {
                transCont.style.display = 'inline';
                transBut.className = 'availTabActive';
                if (!noInit) { initTransportTimes(); }
            }
        break;

        case 'kamers':
            if (kamerCont.display != 'inline') {
                kamerCont.style.display = 'inline';
                kamerBut.className = 'availTabActive';
            }
        break;

        default:
            planCont.style.display='inline';
            planBut.className = 'availTabActive';
        break;
    }
}

function reisplanChanged()
{
    if (document.readyState=='complete')
    {
        var packObj = gO('prijsContainer');
        var alertObj = gO('alertContainer');


        gO('tabTransport').style.display = 'none';

        if (packObj) { packObj.style.display='none'; }
        if (alertObj) { alertObj.style.display='none'; }
    }
}

function setTransType(transtype)
{
    document.cookie = "transporttype="+transtype.toString();
}

function setDep(myobj)
{
    document.cookie = "departure="+myobj[myobj.selectedIndex].value;
}

function setDest(myobj)
{
    document.cookie = "destination="+myobj[myobj.selectedIndex].value;
}

function setOut(myflight)
{
    document.cookie = "outbound="+myflight;
}

function setIn(myflight)
{
    document.cookie = "inbound="+myflight;
}

function addExtra(extid, list) {

    var subServ = gO('subServices').value;
    var srvDate = gO('subServiceDates').value;

    hidePopup();

    showPopup(650, 500, '<div style="width: 650px; text-align: center; height: 350px; background-color: #dad1c2; padding-top: 150px">' + jsFlash('', '/flash/wait_steden.swf', 'cursor: pointer', 'middle', '100', '100', '<param name="wmode" value="transparent" />') + '<br/><span style="font-size: 10px; color: #857663">Gegevens extra<br/>worden toegevoegd</span></div>');

    if (gO('prijsContents'))
    {
        gO('prijsContents').innerHTML = '<div style="width: 100%; padding-top: 40px; text-align: center">' + jsFlash('', '/flash/wait_steden.swf', 'cursor: pointer', 'middle', '100', '100', '<param name="wmode" value="transparent" />') + '<br/><span style="font-size: 10px; color: #857663">Pakketprijs<br/>wordt opgevraagd</span></div>';
//        '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" style="width: 100px; height: 100px; cursor: pointer"><param name="movie" value="/flash/wait_steden.swf" /><param name="wmode" value="transparent" /><!-- [if !IE]> --><em_bed src="/flash/wait_steden.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="100px" height="100px" name="prijs_tag" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>
    }        
    
    Ajax_Code.addExtra(extid, subServ, srvDate, list, SucceededCallback, FailedCallback);
    
    bookedExtras.push(extid);
    
    resetExtraOptions();
}

function addExtraTL(extid, list) {

    var subServ = gO('subServices').value;
    var srvDate = gO('subServiceDates').value;

    hidePopup();

    showPopup(650, 500, '<div style="width: 650px; text-align: center; height: 350px; background-color: #dad1c2; padding-top: 150px">' + jsFlash('', '/flash/wait_steden.swf', 'cursor: pointer', 'middle', '100', '100', '<param name="wmode" value="transparent" />') + '<br/><span style="font-size: 10px; color: #857663">Gegevens extra<br/>worden toegevoegd</span></div>');

    if (gO('prijsContents')) {
        gO('prijsContents').innerHTML = '<div style="width: 100%; padding-top: 40px; text-align: center">' + jsFlash('', '/flash/wait_steden.swf', 'cursor: pointer', 'middle', '100', '100', '<param name="wmode" value="transparent" />') + '<br/><span style="font-size: 10px; color: #857663">Pakketprijs<br/>wordt opgevraagd</span></div>';
        //        '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" style="width: 100px; height: 100px; cursor: pointer"><param name="movie" value="/flash/wait_steden.swf" /><param name="wmode" value="transparent" /><!-- [if !IE]> --><em_bed src="/flash/wait_steden.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="100px" height="100px" name="prijs_tag" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>
    }

    Ajax_Code.addExtraTL(extid, subServ, srvDate, boekingsnrTL, SucceededCallback, FailedCallback);

}

function resetExtraOptions() {
    for (extitercol = 0; extitercol < extraTabelID.length; extitercol++) {
        var myexts = gO(extraTabelID[extitercol]).getElementsByTagName('div');

        var bookedstr = '|' + bookedExtras.join('|') + '|'

        for (i = 0; i < myexts.length; i++) {
            if (myexts[i].id.substr(0, 6) == 'extobj') {
                var extid = myexts[i].id.substr(myexts[i].id.indexOf('_') + 1);
                var nbrcode = myexts[i].getAttribute('nbrcode');
                var cat1 = myexts[i].getAttribute('cat1');

                if ((bookedstr.indexOf('|' + extid + '|') > -1) || (bookedstr.indexOf('|' + cat1 + '|') > -1)) {
                    if (myexts[i].innerHTML.substr(0, 2) == '<i') {
                        myexts[i].innerHTML = '<img style="cursor: pointer; float: right" src="/App_image/extra_verwijder.png" onclick="javascript:Ajax_Code.removeExtra(\'' + cat1 + '\', SucceededCallback, FailedCallback);" alt="Verwijder extra" />';
                    } else {
                        myexts[i].innerHTML = '<div style="cursor: pointer" onclick="javascript:Ajax_Code.removeExtra(\'' + cat1 + '\', SucceededCallback, FailedCallback);"><table cellpadding="0" cellpadding="0"><tr><td><img src="/App_image/button/del_room.png" alt="Verwijder" /></td><td style="padding-left: 4px; font-weight: bold; padding-top: 2px; font-size: 11px">Verwijder extra</td></tr></table></div>';
                    }
                } else {
                    if (myexts[i].innerHTML.substr(0, 2) == '<i') {
                        myexts[i].innerHTML = '<img style="cursor: pointer; float: right" src="/App_image/extra_voeg_toe.png" onclick="javascript:Ajax_Code.nw_addExtra(\'' + nbrcode + '\', SucceededCallback, FailedCallback); " alt="Voeg toe aan boeking" />';
                    } else {
                        myexts[i].innerHTML = '<div style="cursor: pointer" onclick="javascript:Ajax_Code.nw_addExtra(\'' + nbrcode + '\', SucceededCallback, FailedCallback); "><table cellpadding="0" cellpadding="0""<tr><td><img src="/App_image/button/add_orange.png" alt="Voeg toe aan boeking" /></td><td style="padding-left: 4px; font-weight: bold; padding-top: 2px; font-size: 11px">Voeg toe aan mijn boeking</td></tr></table></div>';
                    }
                }
            }
        }
    }
}

function initExtra(extid, city){
    showPopup(650, 500, '<div style="width: 650px; text-align: center; height: 350px; background-color: #dad1c2; padding-top: 150px">' + jsFlash('', '/flash/wait_steden.swf', 'cursor: pointer', 'middle', '100', '100', '<param name="wmode" value="transparent" />') + '<br/><span style="font-size: 10px; color: #857663">Gegevens extra<br/>worden opgevraagd</span></div>');

    var fromDate;
    var toDate;
    var numVolw=0;
    var numKind=0;
    
    var objDep = gO(departureID);
    var objDst = gO(destinationID);

    if (city)
    {
        if (formHeen.value==null) { fromDate=''; } else { fromDate=formHeen.value; }
        if (formTerug.value==null) { toDate=''; } else { toDate=formTerug.value; }
        if (formVolw) { numVolw=parseInt(formVolw[formVolw.selectedIndex].value); }
        if (formKind) { numKind=parseInt(formKind[formKind.selectedIndex].value); }

        Ajax_Code.showExtra(extid, formVolw[formVolw.selectedIndex].value, formKind[formKind.selectedIndex].value, formBaby[formBaby.selectedIndex].value, fromDate, toDate, roomStr(), formTransport, objDep[objDep.selectedIndex].value, objDst[objDst.selectedIndex].value, hotelid, myBoard(), SucceededCallback, FailedCallback);
    } else {
        if (formHeen)
        {
            if (formTerug)
            {
                if (formVolw)
                {
                    if (formKind)
                    {
                        fromDate=formHeen.value;
                        toDate=formTerug.value;
                        numVolw=parseInt(formVolw[formVolw.selectedIndex].value);
                        numKind=parseInt(formKind[formKind.selectedIndex].value);                                
                    }
                }
            }
        }
        
        Ajax_Code.showExtra(extid, formVolw[formVolw.selectedIndex].value, formKind[formKind.selectedIndex].value, formBaby[formBaby.selectedIndex].value, formHeen.value, formTerug.value, roomStr(), formTransport, objDep[objDep.selectedIndex].value, objDst[objDst.selectedIndex].value, hotelid, myBoard(), SucceededCallback, FailedCallback);
    }
}

function initExtraFromBoeking(extid, city) {
    showPopup(650, 500, '<div style="width: 650px; text-align: center; height: 350px; background-color: #dad1c2; padding-top: 150px">' + jsFlash('', '/flash/wait_steden.swf', 'cursor: pointer', 'middle', '100', '100', '<param name="wmode" value="transparent" />') + '<br/><span style="font-size: 10px; color: #857663">Gegevens extra<br/>worden opgevraagd</span></div>');

    var fromDate;
    var toDate;
    var numVolw = 0;
    var numKind = 0;

    if (city) {
        if (formHeen.value == null) { fromDate = ''; } else { fromDate = formHeen.value; }
        if (formTerug.value == null) { toDate = ''; } else { toDate = formTerug.value; }
        if (formVolw) { numVolw = parseInt(formVolw[formVolw.selectedIndex].value); }
        if (formKind) { numKind = parseInt(formKind[formKind.selectedIndex].value); }

        Ajax_Code.showExtra(extid, fromDate, toDate, numVolw, numKind, SucceededCallback, FailedCallback);
    } else {
        if (formHeen) {
            if (formTerug) {
                if (formVolw) {
                    if (formKind) {
                        fromDate = formHeen;
                        toDate = formTerug;
                        numVolw = parseInt(formVolw);
                        numKind = parseInt(formKind);
                    }
                }
            }
        }

        Ajax_Code.showExtraTL(extid, fromDate, toDate, numVolw, numKind, SucceededCallback, FailedCallback);
    }
}

function getAvatarID(id)
{
    var tableObj = gO(avTableID);
    
    var checkCells = tableObj.getElementsByTagName('td');
    
    for (i=0; i<checkCells.length; i++)
    {
        if (checkCells[i].childNodes[0])
        {
            if (checkCells[i].childNodes[0].avatarid==id)
            {
                return checkCells[i].childNodes[0];     
            }
        }
    }
}

function selectAvatar(myobj)
{
    var tableObj = gO(avTableID);
    
    var checkCells = tableObj.getElementsByTagName('td');
    
    for (i=0; i<checkCells.length; i++)
    {
        if (checkCells[i].childNodes[0])
        {
            if (checkCells[i].childNodes[0].style.borderColor=='#000000')
            {
                checkCells[i].childNodes[0].style.borderColor='#f6f1eb';
            }
        }
    }
    
    myobj.style.borderColor='#000000';

    gO('newAvatar').innerHTML = '<img id="newAvatarImg" style="width: 75px" src="'+myobj.imgurl+'" alt="Avatar" />';
    gO(avatarURLid).value=myobj.avatarid;
}

function updateAvatar(imgurl)   
{
    gO('newAvatar').innerHTML = '<img id="newAvatarImg" style="width: 75px" src="'+imgurl+'" alt="Avatar" />';
    gO(avatarURLid).value=imgurl;
    
}

function setNieuwsbrief(valstr)
{
    var vals= new Array();
    
    vals=valstr.split(',');
    
    gO(vals[0]).value=vals[1];
}

function waitForIt()
{
    document.body.style.cursor='wait';
    barTO = setTimeout(showWaitBat, 500);
}

var sFw;
var barobj;
   
var txt1str='';
var txt2str='';

function showWaitBat()
{
    barobj=gO('waitBar');
    bartxt1=gO('waitTxt1');
    bartxt2=gO('waitTxt2');

    barobj.style.width=BrowserWidth()+'px';
    barobj.style.top=((parseInt(BrowserHeight()) / 2)-70+parseInt(PageScrollY())).toString()+'px';
    barobj.style.display='inline';
    barobj.innerHTML = '<div style="position: relative; text-align: center">' + jsFlash('disabled', '/flash/transbar.swf', 'cursor: pointer; text-align: middle', 'middle', BrowserWidth().toString(), '140', '<param name="wmode" value="transparent" /><param name="allowScriptAccess" value="sameDomain" /><param name="scale" value="exactfit" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />') 
    //<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+BrowserWidth().toString()+'" height="140" id="disabled" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/flash/transbar.swf" /><param name="scale" value="exactfit" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><em_bed src="/flash/transbar.swf" quality="high" scale="exactfit" wmode="transparent" bgcolor="#ffffff" width="'+BrowserWidth().toString()+'" height="140" name="disabled" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>';
    barobj.innerHTML = barobj.innerHTML + '<div style="position: absolute; top: 10px; left: ' + ((BrowserWidth() / 2) - 51).toString() + 'px">' + jsFlash('waitflash', '/flash/wait.swf', 'cursor: pointer; text-align: middle', 'middle', '103', '120', '<param name="wmode" value="transparent" /><param name="allowScriptAccess" value="sameDomain" /><param name="scale" value="exactfit" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />') + '</div></div>';    
    //<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="103" height="120" id="waitflash" align="middle"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/flash/wait.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><em_bed src="/flash/wait.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="103" height="120" name="waitflash" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>

    if (txt1str!='')
    {
        bartxt1.innerHTML = '<div style="position: relative; text-align: center">' + jsFlash('disabledt1', '/flash/waittext.swf', 'text-align: middle', 'middle', '400', '100', '<param name="wmode" value="transparent" /><param name="FlashVars" value="txtobj=\n' + txt1str + '" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />') + '</div>';
        //<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="400" height="100" id="disabled" align="middle"><param name="FlashVars" value="txtobj=\n'+txt1str+'" /><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/flash/waittext.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><em_bed src="/flash/waittext.swf" FlashVars="txtobj='+txt1str+'" quality="high" wmode="transparent" bgcolor="#ffffff" width="400" height="100" name="disabled" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>

        bartxt1.style.top=((parseInt(BrowserHeight()) / 2)-80+parseInt(PageScrollY())).toString()+'px';
        bartxt1.style.display='inline';
        bartxt1.style.left=((BrowserWidth()/2)-480).toString()+'px';
    }    

    if (txt2str!='') {
        bartxt2.innerHTML = '<div style="position: relative; text-align: center">' + jsFlash('disabledt2', '/flash/waittext.swf', 'text-align: middle', 'middle', '400', '100', '<param name="wmode" value="transparent" /><param name="FlashVars" value="txtobj=\n' + txt2str + '" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />') + '</div>';
        //bartxt2.innerHTML='<div style="position: relative; text-align: center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="400" height="100" id="disabled" align="middle"><param name="FlashVars" value="txtobj=\n'+txt2str+'" /><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="/flash/waittext.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" /><em_bed src="/flash/waittext.swf" FlashVars="txtobj='+txt2str+'" quality="high" wmode="transparent" bgcolor="#ffffff" width="400" height="100" name="disabled" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object></div>';
        bartxt2.style.top=((parseInt(BrowserHeight()) / 2)-80+parseInt(PageScrollY())).toString()+'px';
        bartxt2.style.display='inline';
        bartxt2.style.left=((BrowserWidth()/2)+80).toString()+'px';
    }    
    
    sFw = setTimeout(followWaitBat, 500);
}

function followWaitBat()
{
    var targetY=((parseInt(BrowserHeight()) / 2)-70+parseInt(PageScrollY()));
    var currentY=parseInt(barobj.style.top.replace('px',''));
    
    if (barobj.style.display=='inline')
    {
        if (targetY!=currentY)
        {
            var newY=Math.ceil(targetY+((currentY-targetY)/7));
            
            if (Math.abs(newY-currentY)<2)
            {
                newY=targetY;
            }
            
            barobj.style.top=newY.toString()+'px';
            bartxt1.style.top=(newY-10).toString()+'px';
            bartxt2.style.top=(newY-10).toString()+'px';
            
            sFw = setTimeout(followWaitBat, 200);
        } else {
            sFw = setTimeout(followWaitBat, 500);
        }
    }
}

function hideWaitBat()
{
    barobj=gO('waitBar');
    if (barobj)
    {
        barobj.style.display='none';
        if (bartxt1) { bartxt1.style.display='none'; }
        if (bartxt2) { bartxt2.style.display='none'; }
        barobj.innerHTML='';
    }
    txt1str='';
    txt2str='';
    sFw = null;
}

function stopWaitForIt()
{
    hideWaitBat();
    document.body.style.cursor='default';
}

function waitForItObj(myobj)
{
    if (myobj.className.indexOf('action')>-1)
    {
        myobj.className=myobj.className.replace('action','wait');
    } else {
        myobj.style.cursor='wait';
    }
    
    waitForIt();
}

function dynamicTransport(myarr, selectedTrans)
{
    var retVal = '<table cellpadding="0" cellspacing="0"><tr>';
    
    for (i=0; i<myarr.length; i++)
    {
        retVal += '<td style="padding-right: 3px">' + transportRadioDark(myarr[i], selectedTrans) +'</td>';
    }
    
    retVal = retVal + '</tr></table>';
    return retVal;
}

function transportRadioDark(transType, selected)
{
    var checkStr = '';
    
    if (selected==transType)
    {
        checkStr = ' checked="checked"'
    }
    
    var altText = '';
    var imgUrl = '';
    
    switch (transType)
    {
        case '12':
            altText = 'per vliegtuig';
            imgUrl = '/App_Image/icon/transport_vlieg.png';
        break;
        
        case '13':
            altText = 'per trein';
            imgUrl = '/App_Image/icon/transport_trein.png';
        break;
        
        case '14':
            altText = 'per boot';
            imgUrl = '/App_Image/icon/transport_boot.png';
        break;
        
        default:
            altText = 'per eigen vervoer';
            imgUrl = '/App_Image/icon/transport_eigenvervoer.png';
        break;
    }

    retVal = '<div id="transportPanel" style="width: 40px; height: 19px; background-image:url(\'/App_Image/icon/transport_42.png\'); padding: 1px 1px 1px 1px; text-align: left">';
    retVal = retVal + '<table cellpadding="0" cellspacing="0">';
    retVal = retVal + '<tr>';
    retVal = retVal + '<td><input onclick="javascript:setTransType(' + transType + '); udTO(); " id="transportOptionRadio_' + transType + '" value="' + transType + '" type="radio"'+checkStr+' name="transportOptions" /></td>';
    
    retVal = retVal + '<td><img src="'+imgUrl+'" alt="'+altText+'" /></td>';
    retVal = retVal + '</tr></table></div>';
    
    return retVal;
}

function extDates(selCode)
{
    if (selCode=='')
    {
        var myObj = gO('subServices');
        
        if (myObj.selectedIndex)
        {
            selCode = myObj[myObj.selectedIndex].value;
        } else {
            selCode = myObj.value;
        }
    }
    
    var myDates = gO('subServiceDates');
    
//    while (myDates.length>0)
//    {
//        myDates.remove(0);
//    }
    
//    for (itdate in extraPrices[selCode])
//    {
//        var newOption = document.createElement('option');
//        newOption.value=itdate;
//        newOption.label=formatDate(itdate);
//        //newOption.text=formatDate(itdate);
//        //myDates.appendChild(newOption);
//        addDDitem(myDates, newOption);
//    }
    
    calculateExt();
}

function calculateExt()
{
    var myObj = gO('subServices');
    var myDates = gO('subServiceDates');
    
    var myID = gO('extraID').value;
    var selCode = '';
    var selDate = '';
    
    if (myObj)
    {
        if (myObj.length)
        {
            selCode = myObj[myObj.selectedIndex].value;
        } else {
        //static hidden
            selCode = myObj.value;
        }

    }
    
    if (myDates.length)
    {
        selDate = myDates[myDates.selectedIndex].value;
    }
    
    if (selDate!='')
    {
        if (extraPrices[selCode][selDate]==undefined)
        {
            if (extraPrices[selCode][myDates[0].value]==undefined)
            {
                gO('ePi').innerHTML='<i>Deze ingangsdatum is voor dit type niet mogelijk. Kies een andere datum.</i>';
            } else {
                gO('ePi').innerHTML='&euro; '+ extraPrices[selCode][myDates[0].value] + ' x ' + extPersons.toString() + ' personen = &euro; '+ (extraPrices[selCode][myDates[0].value]*extPersons).toString();            
            }
        } else {
            gO('ePi').innerHTML='&euro; '+ formatPrice(extraPrices[selCode][selDate]) + ' x ' + extPersons.toString() + ' personen = &euro; '+ formatPrice(((parseFloat(extraPrices[selCode][selDate])*100)*extPersons)/100);
        }
    }
}


function formatPrice(myvalue)
{
    var startDec = myvalue.toString().replace('.',',').replace(' ','');

    while ((startDec.indexOf(',')>=startDec.length-2) && (startDec.indexOf(',')>-1))
    {
        startDec = startDec + '0';
    }
    
    return startDec;
}

function hideHotelInfo()
{
    var mOp = gOp(gO('hotelInfoBorder'))
    if (mOp>0)
    {
        var nOp = mOp - 10;
        if (nOp < 0) { nOp = 0; }
        
        sOp(gO('hotelInfoBorder'), nOp);
        
        hotelTO = setTimeout(hideHotelInfo, 10);
    }
}

function sOp(myObj, alphaPercent)
{
    myObj.style.filter='alpha(opacity='+alphaPercent.toString()+')';
    myObj.style.opacity=(alphaPercent/100);
}

function gOp(myObj)
{
    if (myObj.style.filter)
    {
        return parseInt(myObj.style.filter.substr(myObj.style.filter.indexOf('=')+1));
    } else if (myObj.style.opacity) {
        return myObj.style.opacity*100;
    } else {
        return 100;
    }
}

function showTabs(tabType)
{
    switch(tabType)
    {
        case 'offers':
            if (gO('tabTransport').style.display=='none')
            {
                gO('tabOffers').style.right='130px';
            } else {
                gO('tabOffers').style.right='260px';
            }

            gO('tabOffers').style.display='block';
        break;
        
        case 'transport':
            if (gO('tabOffers').style.display!='none')
            {
                gO('tabOffers').style.right='260px';
            }
                    
            gO('tabTransport').style.display='block';
        break;
    }

}

function preInitYear(myDD)
{
    if (myDD.selectedIndex==0)
    {
        myDD.selectedIndex=70;
    }
}

function tellaFriend()
{
    Ajax_Code.getTafData(SucceededCallback, FailedCallback);
}

function showPriceInfo() {
    var myPanel = gO('showPanel');
    var myStyle = getStyle('showPanel');

    if (browser.isIE) {
        x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
        y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
    }
    if (browser.isNS) {
        x = event.clientX + window.scrollX;
        y = event.clientY + window.scrollY;
    }

    myStyle.display = 'inline';
    myStyle.width = '220px';
    myStyle.height = '160px';
    myStyle.left = (x - 330).toString() + 'px';
    myStyle.top = (y - 100).toString() + 'px';

    var persstr = '';

    var volwobj = gO(noVolwID);
    var kindobj = gO(noKindID);

    if (volwobj) {
        if (kindobj) {
            if (parseInt(kindobj[kindobj.selectedIndex].value) > 0) {
                persstr = ' ' + parseInt(volwobj[volwobj.selectedIndex].value).toString() + ' volwassenen en ' + parseInt(kindobj[kindobj.selectedIndex].value).toString() + ' kinderen. ';
            } else {
                persstr = ' ' + parseInt(volwobj[volwobj.selectedIndex].value).toString() + ' volwassenen. ';
            }
        } else {
            persstr = ' het aantal door u ingevulde personen in het reisplan '
        }
        var numPers = parseInt(volwobj[volwobj.selectedIndex].value) + parseInt(kindobj[kindobj.selectedIndex].value);
    } else {
        persstr=' het aantal door u ingevulde personen in het reisplan. '
    }

    var mydiv = '';
    mydiv = '<div style="width: 220px; position: absolute; left: 100px; top: 100px; background-color: #FFFFFF"><table cellpadding="0" cellspacing="0"><tr><td width="3px"><div style="width: 3px; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border1.png\'); background-repeat: no-repeat">&nbsp;</div></td><td><div style="width: 100%; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border6.png\'); background-repeat: repeat-x">&nbsp;</div></td><td width="3px"><div style="width: 3px; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border2.png\'); background-repeat: no-repeat">&nbsp;</div></td></tr><tr><td style="background-image: url(\'/App_Image/border/border5.png\'); background-repeat: repeat-y"><div style="width: 3px; overflow: hidden">&nbsp;</div></td><td id="contentCell" style="width: 178px; padding: 5px 5px 5px 5px; background-color:#f6f1eb">';
    mydiv = mydiv + '<div style="width: 196px; background-color: #dad1c2; padding: 4px 4px 4px 4px; font-size: 12px"><b>Pakketprijs</b><br/><br/>Deze prijs is gebaseerd op een 2-persoonskamer en' + persstr + '<br/><br/>We streven er naar om hier een zo actueel mogelijke prijs te tonen, maar het kan voor komen dat er een hoger of lager transporttarief van toepassing is.<br/><br/>De actuele prijs incl. alle heffingen en toeslagen kunt u op de hotelpagina opvragen.<br/></div>';
    mydiv = mydiv + '</td><td style="background-image: url(\'/App_Image/border/border7.png\'); background-repeat: repeat-y"><div style="width: 3px; overflow: hidden">&nbsp;</div></td></tr><tr><td width="3px"><div style="width: 3px; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border4.png\'); background-repeat: no-repeat">&nbsp;</div></td><td><div style="width: 100%; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border8.png\'); background-repeat: repeat-x">&nbsp;</div></td><td width="3px"><div style="width: 3px; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border3.png\'); background-repeat: no-repeat">&nbsp;</div></td></tr></table></div>';

    myPanel.innerHTML = mydiv;
}

function showPriceSpec(event, mouseorigin)
{
    var myPanel=gO('showPanel');
    var myStyle=getStyle('showPanel');
    
    if (mouseorigin)
    {
        if (browser.isIE) {
            x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
            y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
        }
        if (browser.isNS) {
            x = event.clientX + window.scrollX;
            y = event.clientY + window.scrollY;
        }
        
        myStyle.display='inline';
        myStyle.width='200px';
        myStyle.height='160px';
        myStyle.left=(x-310).toString()+'px';
        myStyle.top=(y-100).toString()+'px';
    }
    
    var mydiv='';
    
    if (priceSpec=='')
    {
        priceSpec='pending';

        mydiv = '<div style="width: 40px; position: absolute; left: 100px; top: 100px; background-color: #FFFFFF"><table cellpadding="0" cellspacing="0"><tr><td width="3px"><div style="width: 3px; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border1.png\'); background-repeat: no-repeat">&nbsp;</div></td><td><div style="width: 100%; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border6.png\'); background-repeat: repeat-x">&nbsp;</div></td><td width="3px"><div style="width: 3px; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border2.png\'); background-repeat: no-repeat">&nbsp;</div></td></tr><tr><td style="background-image: url(\'/App_Image/border/border5.png\'); background-repeat: repeat-y"><div style="width: 3px; overflow: hidden">&nbsp;</div></td><td id="contentCell" style="width: 178px; padding: 5px 5px 5px 5px; background-color:#f6f1eb">';
        mydiv = mydiv + '<div style="width: 30px; background-color: #dad1c2; padding: 4px 4px 4px 4px"><img src="/App_Image/waiting.gif" /></div>';
        mydiv = mydiv + '</td><td style="background-image: url(\'/App_Image/border/border7.png\'); background-repeat: repeat-y"><div style="width: 3px; overflow: hidden">&nbsp;</div></td></tr><tr><td width="3px"><div style="width: 3px; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border4.png\'); background-repeat: no-repeat">&nbsp;</div></td><td><div style="width: 100%; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border8.png\'); background-repeat: repeat-x">&nbsp;</div></td><td width="3px"><div style="width: 3px; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border3.png\'); background-repeat: no-repeat">&nbsp;</div></td></tr></table></div>';   
        myPanel.innerHTML = mydiv;    
        
        Ajax_Code.loadPriceSpec(SucceededCallback, FailedCallback);
    } else if (priceSpec != 'pending') {
        mydiv = '<div style="width: 200px; position: absolute; left: 100px; top: 100px; background-color: #FFFFFF"><table cellpadding="0" cellspacing="0"><tr><td width="3px"><div style="width: 3px; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border1.png\'); background-repeat: no-repeat">&nbsp;</div></td><td><div style="width: 100%; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border6.png\'); background-repeat: repeat-x">&nbsp;</div></td><td width="3px"><div style="width: 3px; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border2.png\'); background-repeat: no-repeat">&nbsp;</div></td></tr><tr><td style="background-image: url(\'/App_Image/border/border5.png\'); background-repeat: repeat-y"><div style="width: 3px; overflow: hidden">&nbsp;</div></td><td id="contentCell" style="width: 178px; padding: 5px 5px 5px 5px; background-color:#f6f1eb">';
        mydiv = mydiv + '<div style="width: 176px; background-color: #dad1c2; padding: 4px 4px 4px 4px">'+priceSpec+'<br/></div>';
        mydiv = mydiv + '</td><td style="background-image: url(\'/App_Image/border/border7.png\'); background-repeat: repeat-y"><div style="width: 3px; overflow: hidden">&nbsp;</div></td></tr><tr><td width="3px"><div style="width: 3px; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border4.png\'); background-repeat: no-repeat">&nbsp;</div></td><td><div style="width: 100%; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border8.png\'); background-repeat: repeat-x">&nbsp;</div></td><td width="3px"><div style="width: 3px; height: 3px; overflow: hidden; background-image: url(\'/App_Image/border/border3.png\'); background-repeat: no-repeat">&nbsp;</div></td></tr></table></div>';   

        myPanel.innerHTML = mydiv;  
    }
    
}

function updateTotalAmount(myobj, myamount)
{
    var myPrice = gO('procesPrijs');
    
    if (myPrice)
    {
        var myvalue = parseFloat(myPrice.innerHTML.replace(",","."));
        
        var newvalue = 0;
        
        if (myobj.checked)
        {
            newvalue = Math.ceil((myvalue*100) + (myamount*100))/100;
        } else {
            newvalue = Math.ceil((myvalue*100) - (myamount*100))/100;
        }
        
        var newstr = newvalue.toString();
        
        if (newstr.indexOf(".")==newstr.length-2)
        {
            myPrice.innerHTML = newstr + '0';
        } else if (newstr.indexOf(".")==-1) {
            myPrice.innerHTML = newstr + ',00';
        } else {
            myPrice.innerHTML = newstr;
        }
        
        myPrice.innerHTML=myPrice.innerHTML.replace('.',',');
    }
}

function zekerWeten(wat)
{
    switch (wat.toLowerCase())
    {
        case "verwijderprofiel":
            if (confirm('Weet u zeker dat u uw profiel wilt verwijderen?'))
            {
                gO(formAction).value = 'verwijder_profiel';
                document.forms[0].submit();
            }
        break;
    }
}

function adminLogin(e)
{
    var evtobj=window.event? event : e;
    
    if (evtobj.ctrlKey)
    {
        window.location.href='/Secure/inloggen.aspx';
    }
}

function sendTafMail()
{
   Ajax_Code.sndTafMail(gO('eigenName').value, gO('eigenMail').value, gO('friendName').value, gO('friendMail').value, gO('friendMessage').value, SucceededCallback, FailedCallback);
}

function noVolw()
{
    if (noVolwID)
    {
        return gO(noVolwID);
    }
    
    return null;
}

function noKind()
{
    if (noKindID)
    {
        return gO(noKindID);
    }
    
    return null;
}

function codeToevoegen()
{
    var html='<div style="width: 316px; height: 266px; background-color: #dad1c2; padding: 8px 8px 8px 8px">';
    
    html=html+'<div style="width: 300px; height: 250px; background-color: #FFFFFF; padding: 8px 8px 8px 8px">&nbsp;</div>';
    html=html+'';
    html=html+'';
    
    
    
    html=html+'</div>';
    
    
    showPopup(300, 250, html);
}

function checkForEnter(e, actie) {
    var evtobj = window.event ? event : e;
    
    if (evtobj.keyCode == 13) { submitForm(actie); }
}


function showLogin(page) {
    mydiv = '<div style="width: 240px; padding: 4px 4px 4px 4px; background-color: #FFFFFF">';
    mydiv = mydiv + '<div style="width: 240px; border-bottom: solid 1px #FFFFFF; padding-bottom: 2px; background-color: #dad1c2;"><img src="/App_Image/inloggen_popup.png" alt="Inloggen" /></div>';
    mydiv = mydiv + '<div style="width: 224px; height: 80px; background-color: #dad1c2; padding: 8px 8px 8px 8px">';
    mydiv = mydiv + '<table cellpadding="0" style="width: 100%;font-size: 12px" cellpadding="0">';
    mydiv = mydiv + '<tr><td style="width: 85px">E-mail:</td><td><input id="emailAdres" type="text" style="width: 130px" /></td></tr>';
    mydiv = mydiv + '<tr><td>Wachtwoord:</td><td><input id="passWord" type="password" style="width: 130px" /></td></tr>';
    mydiv = mydiv + '</table><table cellpadding="0" style="width: 100%;font-size: 12px" cellpadding="0">';
    mydiv = mydiv + '<tr><td style="font-style: italic; font-size: 10px; vertical-align: bottom; text-decoration: underline"><div style="cursor: pointer" onclick="javascript:showPass();">Wachtwoord vergeten?</div></td><td style="text-align: right; padding-top: 3px"><input id="inlogButton" type="button" onclick="javascript:manualLogin();" value="Inloggen" /></td></tr>';
    mydiv = mydiv + '</table></div></div>';
    showPopup(248, 160, mydiv);
}

function showPass() {
    mydiv = '<div style="width: 248px; background-color: #FFFFFF">';
    mydiv = mydiv + '<div style="width: 240px; border-bottom: solid 1px #FFFFFF; padding-bottom: 2px; background-color: #dad1c2; margin-left: 4px; margin-top: 4px"><img src="/App_Image/pass_popup.png" alt="Wachtwoord opvragen" /></div>';
    mydiv = mydiv + '<div style="width: 224px; height: 80px; background-color: #dad1c2; margin-left: 4px; margin-bottom: 4px; padding: 8px 8px 8px 8px">';
    mydiv = mydiv + '<table cellpadding="0" style="width: 100%;font-size: 12px" cellpadding="0">';
    mydiv = mydiv + '<tr><td style="width: 85px">E-mail:</td><td><input id="emailAdres" type="text" style="width: 130px" /></td></tr>';
    mydiv = mydiv + '<tr><td>&nbsp;</td><td><div style="height: 16px">&nbsp;</div></td></tr>';
    mydiv = mydiv + '</table><table cellpadding="0" style="width: 100%;font-size: 12px" cellpadding="0">';
    mydiv = mydiv + '<tr><td style="font-style: italic; font-size: 10px; vertical-align: bottom">&nbsp;</td><td style="text-align: right; padding-top: 3px"><input id="passButton" type="button" onclick="javascript:requestPass();" value="Opvragen" /></td></tr>';
    mydiv = mydiv + '</table></div></div>';
    showPopup(248, 160, mydiv);
}

function manualLogin() {
    gO('inlogButton').disabled=true;

    hidePopup();

    txt1str = '\nInloggegevens worden geverifieerd';
    showWaitBat();

    Ajax_Code.loginManual(gO('emailAdres').value, gO('passWord').value, SucceededCallback, FailedCallback);
}

function requestPass() {
    hidePopup();

    txt1str = '\nUw verzoek wordt verwerkt';
    showWaitBat();

    Ajax_Code.passRequest(gO('emailAdres').value, SucceededCallback, FailedCallback);
}

function showBigAlert(alert) {
    hideWaitBat();
    gO('formAlertBig').innerHTML='<div id="errorPanel" style="font-weight:bold; color: #FFFFFF; margin-top:12px; width: 690px; height: 16px; overflow: hidden; padding: 8px 12px 8px 22px; background-image: url(\'/App_Image/form_alert_server.png\'); background-repeat: no-repeat">'+alert+'</div>';
}



function setCookie(c_name,value,exdays)
 {
 var exdate=new Date();
 exdate.setDate(exdate.getDate() + exdays);
 var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString())+"; path=/";
 document.cookie=c_name + "=" + c_value;
 }

function getCookie(c_name)
 {
 var i,x,y,ARRcookies=document.cookie.split(";");
 for (i=0;i<ARRcookies.length;i++)
 {
   x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
   y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
   x=x.replace(/^\s+|\s+$/g,"");
   if (x==c_name)
     {
     return unescape(y);
     }
   }
 }

 function loadExtraParameters(myobj) {
     var cat1 = myobj.id.substr(myobj.id.indexOf('_') + 1);

     var startdate = gO('date_' + cat1).value;
     var cat2 = gO('cat2_' + cat1).value;
     
     Ajax_Code.getExtraCat3(startdate, cat1, cat2, SucceededCallback, FailedCallback);
 }

 function changeExtraParameters(myobj) {
     var cat1 = myobj.id.substr(myobj.id.indexOf('_') + 1);

     var startdate = gO('date_' + cat1).value;
     var cat2 = gO('cat2_' + cat1).value;
     var cat3 = gO('cat3_' + cat1).value;

     Ajax_Code.getExtraPrice(startdate, cat1, cat2, cat3, SucceededCallback, FailedCallback);
 }

 var alertsUp = 30;
 var alertTO;

 function showAlert(event, msg)
{
    alertObj.opacity = 100;
    alertTxt.innerHTML = msg;

    alertObj.style.opacity = 1;
    alertObj.style.filter = 'alpha(opacity=100)';    
    
    if (browser.isIE) {
        document.attachEvent("onmousemove", moveAlert);
    }
    if (browser.isNS || browser.isIE9) {
        document.addEventListener("mousemove", moveAlert, true);
    }

    if (alertTO) {
        clearTimeout(alertTO);
    } else {
        alertTO = 0;
    }

    alertTO = setTimeout(fadeAlert, 3000);

    moveAlert(event);
}

function fadeAlert() {
    if (alertObj) {
        if (alertObj.opacity > 0) {
            alertObj.opacity = alertObj.opacity - 5;

            alertObj.style.opacity = (alertObj.opacity / 100);
            alertObj.style.filter = 'alpha(opacity=' + alertObj.opacity.toString() + ')';

            alertTO = setTimeout(fadeAlert, 50);
        } else {
            hideAlert();
        }
    }
    //showPersistent();
}

function hideAlert() {
    if (alertObj) {
        alertObj.style.display = 'none';
        alertTxt.innerHTML = '';

        if (browser.isIE) {
            document.detachEvent("onmousemove", moveAlert);
        }
        if (browser.isNS || browser.isIE9) {
            document.removeEventListener("mousemove", moveAlert, true);
        }
    }
}

function moveAlert(event) {
    var x, y;

    if (alertObj.style.display == 'none') { alertObj.style.display = 'inline'; }
    // Get cursor position with respect to the page.
    if (browser.isIE9) {
        x = window.event.clientX;
        y = window.event.clientY;
    } else if (browser.isIE) {
        x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft;
        y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop;
    }

    if (browser.isNS) {
        x = event.clientX;  //+ window.scrollX;
        y = event.clientY;  //+ window.scrollY;
    }

    alertObj.style.left = (x + 10).toString() + 'px';
    alertObj.style.top = (y - alertsUp).toString() + 'px';
}

function headerOver(myobj) {
    myobj.className = 'headerMenuItemOver';
    hideExtraHotels();
}

function headerOut(myobj) {
    myobj.className = 'headerMenuItem';
}

function hotelsOver(myobj) {
    headerOver(myobj);
    clearTimeout(extraHotTO);
    showExtraHotels();
}

var extraHotTO;
function hotelsOut(myobj) {
    headerOut(myobj);
    extraHotTO = setTimeout(hideExtraHotels, 600);
}

function showExtraHotels() {
    if (gO('hotelTypes')) {
        gO('hotelTypes').style.display = 'block';
    }
}

function hideExtraHotels() {
    if (gO('hotelTypes')) {
        gO('hotelTypes').style.display = 'none';
    }
}

