/*  
AiSE BLOCK LIBRARY.
Deze code in <body> van client toevoegen: <script type='text/javascript' src='http://projecten.elitech.nl/dreizen/js/aise.js'></script>
*/

var et_loc = window.top.location.href.substring(0, 5).indexOf('https') != -1 ? 'https' : 'http';

/**********************************************************************/
/**********************************************************************/
/*********************** DRAG DROP LIBRARY ****************************/
/**********************************************************************/
/**********************************************************************/
var Dragger = "var eve=arguments.length?arguments[0]:event;" +
              "Drag.ox=eve.clientX-this.offsetLeft;" +
              "Drag.oy=eve.clientY-this.offsetTop;" +
              "this.fire=Drag.fire;this.fire();false;";
var Drag = {
    ox: 0, oy: 0,
    minx: null, maxx: null, miny: null, maxy: null,
    mode: 0,
    affine: null,
    initer: null,

    init: function(node, mode, minx, miny, maxx, maxy)
    {
        var retstr = "with(Drag) mode=" + mode + ",minx=" + minx + ",maxx=" + maxx
  			+ ",miny=" + miny + ",maxy=" + maxy + ";Drag.initer=1;" + Dragger;
        node.onmousedown = new Function("e", "return eval(\"" + retstr + "\")");
        return (Drag.initer = retstr);
    },
    add: function(node) { node.out = Drag.out; node.out(null); },
    fire: function()
    {
        var that = this;
        that.run = Drag.run;
        that.out = Drag.out;
        that.style.position = "absolute";
        that.onmousedown = null;
        that.onmouseup = function(e) { return that.out(e); };
        document.onmouseup = function(e) { return that.out(e); };
        document.onmousemove = function(e) { return that.run(e); };
        document.onmouseout = function(e)
        {
            var eve = e ? e : event;
            if (!eve.fromElement)
                eve.fromElement = eve.target, eve.toElement = eve.relatedTarget;
            if (!eve.toElement) that.out(e); return false;
        }; return false;
    },
    run: function(e)
    {
        repositionAfterDrag();
        var eve = e ? e : event;
        var nx = eve.clientX - Drag.ox;
        var ny = eve.clientY - Drag.oy;
        with (Drag)
        {
            if (minx) if (nx < minx) nx = minx;
            if (maxx) if (nx > maxx) nx = maxx;
            if (miny) if (ny < miny) ny = miny;
            if (maxy) if (ny > maxy) ny = maxy;
        } if (this.parentNode.style.position == "absolute")
        {
            nx = nx - this.parentNode.offsetLeft;
            ny = ny - this.parentNode.offsetTop;
        }
        if (Drag.mode < 2) this.style.left = nx + "px";
        if (!(Drag.mode % 2)) this.style.top = ny + "px";
        if (Drag.mode == 3 && Drag.affine)
            Drag.affine(this, nx, ny);
        repositionAfterDrag();
        return false;
    },
    out: function(e)
    {
        var invoker = null;
        document.onmousemove = null;
        document.onmouseup = null;
        document.onmouseout = null;
        this.onmouseup = null;
        with (Drag) { invoker = mode + "," + minx + "," + miny + "," + maxx + "," + maxy; }
        this.onmousedown = new Function("e", "return eval("
  			+ (Drag.initer ? "Drag.init(this," + invoker + ")" : "Dragger") + ")");
        with (Drag) { mode = 0, minx = null, maxx = null, miny = null, maxy = null; initer = null }
        return false;
    }
};


/**********************************************************************
**********************************************************************
*********************** START AISE LIBRARY ***************************
**********************************************************************
**********************************************************************/

/* ====================================================================
* OPHALEN QUERYSTRING VOOR HET AANPASSEN VAN DE OPBOUW/WERKING
* ====================================================================*/
function et_getLastChild(el)
{
    return (el.lastChild && el.lastChild.nodeName != '#text') ? et_getLastChild(el.lastChild) : el;
}
var etRequest = new function()
{  //etRequestFunc
    // Van buitenaf, via de querystring, aan te geven properties.
    this.Start = 0; // meteen standaard waarde geven.

    // Code
    this.et_qs_values;
    this.fill_et_qs_values = new function(caller)
    {
        var et_qs_attributes = []
        var et_qs = et_getLastChild(document.lastChild).getAttribute('src').replace(/.*\?/, '');
        var et_qs_tmparray = et_qs.split('&');
        for (var i = 0; i < et_qs_tmparray.length; i++)
        {
            et_qs_attributes[i] = et_qs_tmparray[i].split('=');
        }
        caller.et_qs_values = et_qs_attributes;
        // Standaard properties vullen
        for (var j = 0; j < caller.et_qs_values.length; j++)
        {
            switch (caller.et_qs_values[j][0].toLowerCase())
            {
                case 'start': caller.Start = caller.et_qs_values[j][1]; break;
            }
        }
    } (this);
    this.Querystring = function(welkevar)
    {
        try
        {
            for (var j = 0; j < this.et_qs_values.length; j++)
            {
                if (this.et_qs_values[j][0] == welkevar)
                {
                    return this.et_qs_values[j][1];
                }
            }
            return '';
        } catch (e)
        {
            return '';
        }
    };
} ();
//var etRequest = new etRequestFunc();
// voorbeeld aanroep: window.setTimeout("alert(etRequest.Querystring('c'))",2000);

//var globalStateForDragStorage = 1;

var AskedFaq = false;
var bShowFaq = false;
var elitechAise = function()
{
    this.klantcode = "DREIZEN";   /* Probeer hier een unieke afkorting te gebruiken voor een klant */
    this.aisetype = "GROOT3";         /* code die een unieke identifier is voor een versie van de aise-vorm */
    this.state = 1;           /* default status */
    this.ShowContactInAnswer = false;
    this.frame1 = "";          /* default waarde frame 1 */
    this.frame2 = "";          /* default waarde frame 2 */
    this.frame3 = "";          /* default waarde frame 3 */
    this.useIframeIEfix = false;       /* in IE liggen selectboxen en flash etc. altijd met de hoogste z-index. als deze optie op true wordt gezet, wordt achter de divs een iframe geplaatst. Dit iframe kan wel over deze controls heen worden gelegd. */
    this.loadingHTML = "... ..."    /* Tekst wordt getoond tijdens het laden */
    this.showDivSources = false;       /* voor debug/design true zetten */
    this.doPagePush = true;        /* aanzetten pagepush optie. Handig om uit te zetten tijdens ontwikkelfase */
    this.beoordeling = '0';            /* beoordeling goed is de defaultwaarde */
    this.handigeVragen = true;        /* maak gebruik van handige vragen */
    this.toonvraag = true;        /* De vraag herhalen in aise responsediv */
    this.pagepushiframe = false;       /* De pagepush uitvoeren naar een achtergrond frame (in geval van demo|testen) */
    this.page_to_be_pushed = 'nee';
    this.testing = false;
    this.RecNr1 = 'leeg';
    this.RecNr2 = 'leeg';
    this.RecNr3 = 'leeg';
    this.DoorverwijzingContact = true;
    this.lastReceived_uid = "";
    this.lastReceived_antwoord = "";
    this.lastReceived_recnr = "";
    this.lastReceived_html = "";
    this.lastReceived_category = "";
    this.lastQuestion = "";
    this.testing = false;
    this.feedbacktestfase = false;
    this.StandaardTekst = "";
	this.landedViaPagePush = '0';

    this.defaultvraag = new Array();
    this.callback = "me.putXMLhere();";
    this.oScript = "";
    this.oScriptChat = "";
    this.ChatOnline = false;
    var me = this;
    //	this.Unanswered			=	"";

    this.convertTo = function()
    {
        me.lastReceived_antwoord = me.lastReceived_antwoord.replace(/&#/gi, "SPECIAL_SIGN");
        me.lastReceived_antwoord = me.lastReceived_antwoord.replace(/;/gi, "PUNT_KOMMA");
        //		me.Unanswered = me.Unanswered.replace(/&#/gi, "SPECIAL_SIGN");
        // 	me.Unanswered = me.Unanswered.replace(/;/gi, "PUNT_KOMMA");
    }
    this.convertFrom = function(value)
    {
        value = value.replace(/SPECIAL_SIGN/gi, "&#");
        value = value.replace(/PUNT_KOMMA/gi, ";");
        return value;
    }
    this.storeAllData = function()
    {
        me.convertTo();
        var aise = document.getElementById('status1div');
        top.window.name = "AISE -!-" + me.klantcode + ";" + me.aisetype + ";" + me.landedViaPagePush + ";" + aise.style.top + ";" + aise.style.left + ";" + me.state + ";pp=" + me.page_to_be_pushed + ";" + me.lastQuestion + ";" + me.lastReceived_antwoord + ";0" // + ";" + me.Unanswered;
    }
    this.repositionFromStorage = function()
    {
        var aise = document.getElementById('status1div');
        var wname = top.window.name.split("-!-");
        if (wname[1])
        {
            if (wname[0].indexOf("AISELINK") > -1)
            {
                document.getElementById('question').value = wname[1];
                document.getElementById('aiseResponseDiv').innerHTML = '...';
                window.setTimeout("aise.sendQuestionDirect()", 250);
            } 
			else
            {
	            var storage = wname[1].split(";");
				if (storage[0] == this.klantcode && storage[1] == this.aisetype)
				{
					aise.style.top = storage[3];
					aise.style.left = storage[4];
					this.state = storage[5];
					document.getElementById('aiseResponseDiv').style.visibility = "visible";
					document.getElementById('aiseResponseDiv').style.display = "block";
				}
				if (storage[0] == this.klantcode)
				{
					this.page_to_be_pushed = storage[6];
					this.lastQuestion = this.convertFrom(storage[7]);
					this.lastReceived_antwoord = this.convertFrom(storage[8]);
					if (this.lastQuestion != "")
					{
						document.getElementById('question').className = "tekstinput";
					}
					document.getElementById('question').value = this.lastQuestion;
					CharTeller(document.getElementById('question'), document.getElementById('vak'), 125);
					document.getElementById('aiseResponseDiv').innerHTML = this.lastReceived_antwoord;
				}
			}
			this.landedViaPagePush = '0';
		}
        else
        {
            aise.style.top = this.defaultFromtop;
            aise.style.left = this.defaultFromLeft;
        }

		this.getChatStatus("ScriptTagIDChat", this.proxychatServer, "dreizen", "false");

		this.changeState();
        return true;
    }
    this.changeState = function()
    {
        if (this.state == 1)
        {
            //document.getElementById('headerImageA').style.display='inline';
            //document.getElementById('headerImageB').style.display='none';
            document.getElementById('status1div').style.display = 'block';
            document.getElementById('status2div').style.display = 'none';
            document.getElementById('status3div').style.display = 'none';
            if (this.useIframeIEfix)
            {
                document.getElementById('status1frame').style.display = 'block';
                document.getElementById('status2frame').style.display = 'none';
                document.getElementById('status3frame').style.display = 'none';
            }
        }
        if (this.state == 2)
        {
            //document.getElementById('headerImageA').style.display='inline';
            //document.getElementById('headerImageB').style.display='inline';
            document.getElementById('status1div').style.display = 'block';
            document.getElementById('status2div').style.display = 'none';
            document.getElementById('status3div').style.display = 'none';
            if (this.useIframeIEfix)
            {
                document.getElementById('status1frame').style.display = 'block';
                document.getElementById('status2frame').style.display = 'none';
                document.getElementById('status3frame').style.display = 'none';
            }
            if (document.getElementById('aiseResponseDiv').innerHTML == '')
            {
                //this.sendQuestionInit();
                return;
            }
            //document.getElementById('question').focus();
        }
        if (this.state == 3)
        {
            //document.getElementById('headerImageA').style.display='inline';
            //document.getElementById('headerImageB').style.display='inline';
            document.getElementById('status1div').style.display = 'block';
            document.getElementById('status2div').style.display = 'none';
            document.getElementById('status3div').style.display = 'block'; // TONEN VOOR TEST_DIALOOG wordt dan display='';   verbergen =>  display='none';
            if (this.useIframeIEfix)
            {
                document.getElementById('status1frame').style.display = 'block';
                document.getElementById('status2frame').style.display = 'none';
                document.getElementById('status3frame').style.display = 'block';
            }
        }
    }
    this.changeStateFromTopDiv = function()
    {
        if ((this.state == 2) || (this.state == 3))
        {
            this.state = 1;
        } else
        {
            this.state = 2;
        }
        this.changeState();
    }
    this.parse = function()
    {
        document.write('<link rel="stylesheet" type="text/css" href="' + this.css + '">');
        if (this.showDivSources)
        {
            document.write('<textarea style="font-family: Verdana; font-size:11px;width:100%;height:33%;">' + this.frame1 + "</textarea>");
            document.write('<textarea style="font-family: Verdana; font-size:11px;width:100%;height:33%;">' + this.frame2 + "</textarea>");
            document.write('<textarea style="font-family: Verdana; font-size:11px;width:100%;height:33%;">' + this.frame3 + "</textarea>");
        }
        document.write(this.frame1);
        document.write(this.frame2);
        document.write(this.frame3);
        var BROWSER_IS_IE = document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1;
        if (!BROWSER_IS_IE) { this.useIframeIEfix = false; }
        if (this.useIframeIEfix)
        {
            var status1div = document.getElementById('status1div');
            document.write("<iframe name='status1frame' id='status1frame' frameborder='0' style='display:none;z-index:900;position:relative;' width='" + status1div.style.width + "' height='" + status1div.style.height + "'></iframe>");
            var status2div = document.getElementById('status2div');
            document.write("<iframe name='status2frame' id='status2frame' frameborder='0' style='moz-opacity:.5;filter:alpha(opacity=0);display:none;z-index:900;position:absolute;' width='" + status2div.style.width + "' height='" + status2div.style.height + "'></iframe>");
            var status3div = document.getElementById('status3div');
            document.write("<iframe name='status3frame' id='status3frame' frameborder='0' style='moz-opacity:.5;filter:alpha(opacity=0);display:none;z-index:900;position:absolute;' width='" + status3div.style.width + "' height='" + status3div.style.height + "'></iframe>");
        }
        if (typeof WindowOnLoadAdd == "function")
        {
            WindowOnLoadAdd('aise.positionAiseOnLoadHandler()');
        } else
        {
            window.onload = this.positionAiseOnLoadHandler;  // Na het laden aise initialiseren
        }
        window.onunload = this.storeAllData;              // Opslaan positie, vraag en antwoord
        //window.onresize = repositionAfterDrag;
    }
    this.positionAiseOnLoadHandler = function()
    {
        /* initialiseer AISE onload */
        if (me.repositionFromStorage())
        {
            //repositionAfterDrag();
            if (me.handigeVragen) { me.setDefaultVragen(); }
            if (aise.page_to_be_pushed == 'ja')
            {
                aise.page_to_be_pushed = 'nee';
            }
        }
        //if (document.getElementById('stretchcontact'))
//        {
//            if (document.getElementById('daphnevrantw'))
//            {
//                document.getElementById('stretchcontact').style.height = document.getElementById('daphnevrantw').clientHeight - 17 + 'px';
//            }
//        }
        //document.getElementById('chatlink').href = "http://chat.d-reizen.nl/client/default.aspx?UID=" + me.lastReceived_uid;
		document.getElementById('chatlink').target = "_self";
		document.getElementById('chatlink').href = "javascript:et_OpenChatWindow();";
    }
    this.setDefaultVragen = function()
    {
        var faqDiv = document.getElementById('faq');
        faqDiv.innerHTML = "";
        for (var loop = 0; loop < this.defaultvraag.length; loop++)
        {
            faqDiv.innerHTML = faqDiv.innerHTML + "<img style='cursor:pointer;' src='" + basicurl + "/img/pijltje.gif' border='0' /><a href='#' onClick=\"" + this.instanceName + ".vraagHandigeVraag('" + this.defaultvraag[loop] + "');return false;\">" + this.defaultvraag[loop] + '</a><br />'
        }
    }
    this.vraagHandigeVraag = function(vraag)
    {
        document.getElementById('question').value = vraag;
        this.sendQuestion();
    }
    this.verwerkHandigeVragen = function(hvragen)
    {
        var faqDiv = document.getElementById('faq');
        faqDiv.innerHTML = "";
        for (var loop = 0; loop < hvragen.length; loop++)
        {
            faqDiv.innerHTML = faqDiv.innerHTML + "<img style='cursor:pointer;' src='" + basicurl + "/img/pijltje.gif' border='0' /><a href='#' onClick=\"" + this.instanceName + ".vraagHandigeVraag('" + hvragen[loop] + "');return false;\">" + hvragen[loop] + '</a><br />'
        }
        if (hvragen.length == 0)
        {
            for (var loop = 0; loop < this.defaultvraag.length; loop++)
            {
                faqDiv.innerHTML = faqDiv.innerHTML + "<img style='cursor:pointer;' src='" + basicurl + "/img/pijltje.gif' border='0' /><a href='#' onClick=\"" + this.instanceName + ".vraagHandigeVraag('" + this.defaultvraag[loop] + "');return false;\">" + this.defaultvraag[loop] + '</a><br />'
            }
        }
    }
    this.getDataFromServer = function(id, url, vraag)
    {
        this.oScript = document.getElementById(id);
        var head = document.getElementsByTagName("head").item(0);
        if (this.oScript)
        {
            // Destory object
            head.removeChild(this.oScript);
        }
        // Create object 
        this.oScript = document.createElement("script");

        var callURL = url + '?projectCode=' + this.projectCode + '&projectID=' + this.projectID + '&uid=' + this.lastReceived_uid + '&vraag=' + escape(vraag);

        //alert("Laatst ontvangen UID: [" + this.lastReceived_uid + "]");
        this.oScript.setAttribute("src", callURL);

        head.appendChild(this.oScript);
        var antwoord = '';
        var BROWSER_IS_IE = document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1;
        if (BROWSER_IS_IE)
        {
            if (this.oScript.readyState == "loaded" || this.oScript.readyState == "complete")
            {
                eval(this.callback);
                this.oScript.onreadystatechange = null;
            } else
            {
                this.oScript.onreadystatechange = this.CheckAgain;
            }
        } else
        {
            //eval(this.callback); // <= zou moeten werken maar de waarden zijn dan toch nog niet geladen. timeout ingebouwd die iedere seconde opnieuw kijkt of het antwoord binnen is..
            aise.mozCheckAgain();
        }
    }
    this.mozCheckAgain = function()
    {
        var chk = typeof (antwoord);
        if (typeof (antwoord) == "string")
        {
            if (antwoord == "")
            {
                // Als antwoorden verwerkt zijn word deze variabele weer leeggemaakt t.b.v. deze controle.
                window.setTimeout("aise.mozCheckAgain()", 1000);
            } else
            {
                aise.putXMLhere()
            }
        } else
        {
            window.setTimeout("aise.mozCheckAgain()", 1000);
        }
    }
    this.CheckAgain = function()
    {
        if (me.oScript.readyState == "loaded")
        {
            eval(me.callback);
            me.oScript.onreadystatechange = null;
        }
    }
    this.getChatStatus = function(id, url, app, goOn)
    {
        this.oScriptChat = document.getElementById(id);
        var head = document.getElementsByTagName("head").item(0);
        if (this.oScriptChat)
        {
            head.removeChild(this.oScriptChat);
        }
        this.oScriptChat = document.createElement("script");
        var callURL = url + '?app=' + app;
        this.oScriptChat.setAttribute("src", callURL);
        this.oScriptChat.setAttribute("id", "chatcheckscript");
        head.appendChild(this.oScriptChat);

        var BROWSER_IS_IE = document.all && window.ActiveXObject && navigator.userAgent.toLowerCase().indexOf("msie") > -1 && navigator.userAgent.toLowerCase().indexOf("opera") == -1;
        if (BROWSER_IS_IE)
        {
            if (this.oScript.readyState == "complete")
            {
                this.oScriptChat.onreadystatechange = null;
                eval("me.checkChatStatus();");
            } else
            {
                if (goOn == "true")
                {
                    this.oScriptChat.onreadystatechange = function() { aise.CheckAgainChat('true') };
                } else
                {
                    this.oScriptChat.onreadystatechange = function() { aise.CheckAgainChat('false') };
                }
            }
        } else
        {
            aise.mozCheckAgainChat(goOn);
        }
    }
    this.checkChatStatus = function(goOn)
    {
        if (aiseAgentIsOnline == "false")
        {
            if (me.ShowContactInAnswer == true)
            {
				//antwoord = antwoord + "<br />Wellicht kunt u de vraag via het <a href='" + et_loc + "://www.d-reizen.nl/voi3/frames/index.do?/voi3/generic/mailform.do?mt=/generic/mail/webmaster&hp=hom'>contact formulier</a> aan mijn collega stellen.";
				antwoord = antwoord + "<br />Wellicht kunt u de vraag via het <a href='javascript:et_OpenContactWindow();'>contact formulier</a> aan mijn collega stellen.";
			}
			document.getElementById('et_ChatOptie_online').style.visibility = "hidden";
            document.getElementById('et_ChatOptie_online').style.display = "none";
            document.getElementById('et_ChatOptie_offline').style.display = "block";
            document.getElementById('et_ChatOptie_offline').style.visibility = "visible";
        } else
        {
            if (me.ShowContactInAnswer == true)
            {
				antwoord = antwoord + "<br />Wellicht kan &#233;&#233;n van mijn collega's u verder helpen. Klik <a href='javascript:et_OpenChatWindow();' target='_self'>hier</a> om een chat te starten met een van mijn collega's.";
			}
			document.getElementById('et_ChatOptie_offline').style.visibility = "hidden";
            document.getElementById('et_ChatOptie_offline').style.display = "none";
            document.getElementById('et_ChatOptie_online').style.display = "block";
            document.getElementById('et_ChatOptie_online').style.visibility = "visible";
        }
        //this.lastReceived_antwoord = antwoord;	
        if (goOn == "true" || goOn == "")
        {
            this.putXMLherePart2();
        }
    }
    this.mozCheckAgainChat = function(goOn)
    {
        var chk = typeof (aiseAgentIsOnline);
        if (typeof (aiseAgentIsOnline) == "string")
        {
            if (aiseAgentIsOnline == "")
            {
                /* Als antwoorden verwerkt zijn word deze variabele weer leeggemaakt t.b.v. deze controle. */
                window.setTimeout("aise.mozCheckAgainChat('" + goOn + "')", 1000);
            } else
            {
                aise.checkChatStatus(goOn);
            }
        } else
        {
            window.setTimeout("aise.mozCheckAgainChat('" + goOn + "')", 1000);
        }
    }
    this.CheckAgainChat = function(goOn)
    {
        if (me.oScriptChat.readyState == "loaded")
        {
            eval("me.checkChatStatus('" + goOn + "');");
            me.oScriptChat.onreadystatechange = null;
        }
    }
    var custom_welcome_asked = false;
    this.sendQuestionDirect = function()
    {
        document.getElementById('aiseResponseDiv').innerHTML = this.loadingHTML;
        custom_welcome_asked = false;
        this.getDataFromServer("ScriptTagID", this.proxyServer,  RemoveXSS(document.getElementById('question').value));
    }
    this.sendQuestion = function()
    {
        document.getElementById('aiseResponseDiv').innerHTML = this.loadingHTML;
        custom_welcome_asked = false;
        this.getDataFromServer("ScriptTagID", this.proxyServer, RemoveXSS(document.getElementById('question').value));
    }
    this.sendQuestionInit = function()
    {
        document.getElementById('aiseResponseDiv').innerHTML = this.loadingHTML;
        custom_welcome_asked = true;
        this.getDataFromServer("ScriptTagID", this.proxyServer, 'custom_welcome');
    }
    this.putXMLhere = function()
    {
        //this.Unanswered 		= 	"";
        this.lastReceived_uid = uid;
        this.lastReceived_antwoord = antwoord;
        this.lastReceived_recnr = recnr;
        this.lastReceived_html = html;
        this.lastReceived_category = category;
        this.lastQuestion = RemoveXSS(document.getElementById('question').value);

//        document.getElementById('chatlink').href = "http://chat.d-reizen.nl/client/default.aspx?UID=" + me.lastReceived_uid;
		document.getElementById('chatlink').target = "_self";
		document.getElementById('chatlink').href = "javascript:et_OpenChatWindow();";

        if (this.RecNr1 == 'leeg')
        { // nog geen vraag gesteld
            this.RecNr1 = recnr;
        } else if (this.RecNr2 == 'leeg')
        { // pas 1 vraag gesteld
            this.RecNr2 = recnr;
            //} else if (this.RecNr3 == 'leeg') { // pas 2 vragen gesteld
            //	this.RecNr3 = recnr;	
        } else
        { //alles gevuld; dus meer dan 3 vragen gesteld
            this.RecNr1 = this.RecNr2;
            //this.RecNr2 = this.RecNr3;	
            this.RecNr2 = recnr;
        }
        if (this.DoorverwijzingContact)
        {
			me.ShowContactInAnswer = false;
            if ((this.RecNr1 != 'leeg' && this.RecNr2 != 'leeg') && ((isNaN(Number(this.RecNr1)) ? Number("1") : Number(this.RecNr1)) <= 0 && (isNaN(Number(this.RecNr2)) ? Number("1") : Number(this.RecNr2)) <= 0))
            {
                me.ShowContactInAnswer = true;
            } else
            {
                if ((this.RecNr1 != 'leeg' && this.RecNr2 != 'leeg') && (this.RecNr1 == this.RecNr2))
                {
                    me.ShowContactInAnswer = true;
                }
            }
			this.getChatStatus("ScriptTagIDChat", this.proxychatServer, "dreizen", "true");
        }
    }
    this.putXMLherePart2 = function()
    {
        if (this.toonvraag == true)
        {
            document.getElementById('aiseResponseDiv').innerHTML = "<strong>" + this.lastQuestion + "</strong><div id='ruimtegesteldevraag'>&nbsp;</div>" + antwoord;
        } else
        {
            document.getElementById('aiseResponseDiv').innerHTML = antwoord;
        }
        if (this.handigeVragen)
        {
            this.verwerkHandigeVragen(hvragen);
        }
        if (html != "")
        {
            if (this.doPagePush)
            {
                if (this.pagepushiframe == true)
                {
                    if (document.getElementById("frame"))
                    {
                        document.getElementById("frame").src = html;
                    }
                } else
                {
					if (html.indexOf("popup|") > -1)
					{
						try
						{
							et_OpenContactWindow(html.split('|')[1]);
						} catch(e){}
					}
					else
					{
						this.page_to_be_pushed = 'ja';
	                    this.landedViaPagePush = '1';
						document.location.href = html;
					}
                }
            } else
            {
                document.getElementById('aiseResponseDiv').innerHTML += '<br /><br /><a href=' + html + '>Meer info</a>';
            }
        }
        document.getElementById('aiseResponseDiv').style.visibility = "visible";
        document.getElementById('aiseResponseDiv').style.display = "block";
        this.state = 2;
        if (this.testing)
        {
            this.state = 3;
        }
        this.changeState();
        if (this.state > 1)
        {
            if (this.toonvraag == true)
            {
                document.getElementById('question').value = "";
                CharTeller(document.getElementById('question'), document.getElementById('vak'), 125);
                document.getElementById('question').focus();
            } else
            {
                document.getElementById('question').focus();
                document.getElementById('question').select();
            }
        }
        //document.getElementById('stretchcontact').style.height = document.getElementById('daphnevrantw').clientHeight - 17 + 'px';
        //alert (document.getElementById('daphnevrantw').clientHeight + 'px');

        antwoord = ""; // Leegmaken ivm firefox wait <- Deze controlleert of antwoord gezet is.
    }
    this.SendOpmerking = function()
    {
        var rsIframe = document.getElementById("RSIFrameOpmerking");
        var beoordeling = document.getElementsByName('beoordeling');

        var tmpuid = this.lastReceived_uid; tmpuid = tmpuid.replace(/\'/g, "`");
        var tmpant = this.lastReceived_antwoord; tmpant = tmpant.replace(/\'/g, "`"); tmpant = tmpant.replace(/\&\#/g, "|"); tmpant = tmpant.replace(/\&/g, " en ");
        var tmprec = this.lastReceived_recnr; tmprec = tmprec.replace(/\'/g, "`");
        var tmphtm = this.lastReceived_html; tmphtm = tmphtm.replace(/\'/g, "`");
        var tmpcat = this.lastReceived_category; tmpcat = tmpcat.replace(/\'/g, "`");
        var tmpque = this.lastQuestion; tmpque = tmpque.replace(/\'/g, "`"); tmpque = tmpque.replace(/\&\#/g, "|"); tmpque = tmpque.replace(/\&/g, " en ");
        var tmpopm = document.getElementById("invoerOpmerking").value; tmpopm = tmpopm.replace(/\'/g, "`"); tmpopm = tmpopm.replace(/\&/g, " en ");
		var tmptestfase = (me.feedbacktestfase == true)?'1':'0';
                var url = this.opmerkingUrl + 
                               '?pro=' + this.projectID +  
                               '&uid=' + tmpuid + 
                               '&vraag=' + tmpque + 
                               '&antwoord=' + tmpant + 
                               '&rec=' + tmprec + 
                               '&cat=' + tmpcat + 
                               '&commentaar=' + tmpopm + 
                               '&score=' + this.beoordeling + 
                               '&testfase=' + tmptestfase;
                url = url.replace(/</g, "<_");


        if (rsIframe == null)
        {
            var iframe = document.createElement("iframe");
            iframe.setAttribute("src", url);
            iframe.setAttribute("id", "RSIFrameOpmerking");
            iframe.setAttribute("scrolling", "no");
            iframe.setAttribute("frameBorder", "5");
            iframe.setAttribute("width", "0");
            iframe.setAttribute("height", "0");
            document.body.appendChild(iframe);
        } else
        {
            rsIframe.src = url;
        }
        document.getElementById('divInvoerOpmerking').style.display = 'none';
        document.getElementById('opmerkingtitel').style.display = 'none';
        this.state = 2;
        this.changeState();
        document.getElementsByName('beoordeling')[0].checked = false;
        document.getElementsByName('beoordeling')[1].checked = false;
        document.getElementsByName('beoordeling')[2].checked = false;
        document.getElementById('invoerOpmerking').value = "";
    }
    this.changeBeoordeling = function(newValue)
    {
        this.beoordeling = newValue;
        if (this.beoordeling == '0')
        {
            document.getElementById('divInvoerOpmerking').style.display = 'none';
            document.getElementById('opmerkingtitel').style.display = 'none';
        } else
        {
            document.getElementById('divInvoerOpmerking').style.display = '';
            document.getElementById('opmerkingtitel').style.display = '';
            if (newValue == 1)
            {
                document.getElementById('opmerkingtitel').innerHTML = 'Voeg hier het antwoord voor deze vraag toe:';
            }
            if (newValue == 2)
            {
                document.getElementById('opmerkingtitel').innerHTML = 'Verduidelijk de fout in het antwoord:';
            }
        }
    }
}

/**********************************************************************/
/**********************************************************************/
/*********************** EINDE AISE LIBRARY ***************************/
/**********************************************************************/
/**********************************************************************/

function repositionAfterDrag()
{
    /* Positioneren van alle DIV's en IFRAMES relatief aan de div "status1div" */
    var MainDiv = document.getElementById('status1div');
    if (true == true)
    {
        if (isIE7())
        {
            //alert(document.documentElement.clientWidth);
            var tmpVal = ((document.documentElement.clientWidth / 2) - 219);
            if (tmpVal < 157) { tmpVal = 157; }
            MainDiv.style.left = tmpVal + "px";
            MainDiv.style.top = "111px";
        } else if (isIE())
        {
            //alert(document.body.clientWidth);
            //MainDiv.style.left = ((document.body.clientWidth/2) - 219) + "px";
            var tmpVal = ((document.body.clientWidth / 2) - 219);
            if (tmpVal < 157) { tmpVal = 157; }
            MainDiv.style.left = tmpVal + "px";
            MainDiv.style.top = "111px";
        } else
        {
            var tmpVal = ((document.body.clientWidth / 2) - 219);
            if (tmpVal < 157) { tmpVal = 157; }
            MainDiv.style.left = tmpVal + "px";
            MainDiv.style.top = "111px";
        }
    }
    var MainPosLeft = MainDiv.style.left.replace('px', '');
    var MainPosTop = MainDiv.style.top.replace('px', '');
    var MainHeight = MainDiv.style.height.replace('px', '') * 1;
    var MainWidth = MainDiv.style.width.replace('px', '') * 1;

    var status2div = document.getElementById('status2div');
    status2div.style.left = (MainPosLeft * 1) + "px";
    status2div.style.top = (MainPosTop * 1) + MainHeight + "px";

    var status3div = document.getElementById('status3div');
    status3div.style.left = (MainPosLeft - status3div.style.width.replace('px', '') * 1 - 3) + "px";
    status3div.style.top = (MainPosTop * 1) + "px";


    if (aise.useIframeIEfix)
    {
        document.getElementById('status1frame').style.top = MainDiv.style.top;
        document.getElementById('status1frame').style.left = MainDiv.style.left;
        document.getElementById('status2frame').style.top = status2div.style.top;
        document.getElementById('status2frame').style.left = status2div.style.left;
        document.getElementById('status3frame').style.top = status3div.style.top;
        document.getElementById('status3frame').style.left = status3div.style.left;
    }
    if (aise.state > 1)
    {
        document.getElementById('question').focus();
        document.getElementById('question').select();
    }
    if (aise.page_to_be_pushed == 'ja')
    {
        aise.page_to_be_pushed == 'nee';
    }
}

/*
function ChangeUitklapTo(naar) {
if (naar == "0") { // klik-banner
document.getElementById('daphnestart').style.visibility = 'visible';
document.getElementById('daphnestart').style.display = 'block';

document.getElementById('daphnetop').style.visibility = 'hidden';
document.getElementById('daphnetop').style.display = 'none';
document.getElementById('daphnestretch').style.visibility = 'hidden';
document.getElementById('daphnestretch').style.display = 'none';
document.getElementById('daphnebottom').style.visibility = 'hidden';
document.getElementById('daphnebottom').style.display = 'none';

document.getElementById('meeropties').style.visibility = 'hidden';
document.getElementById('meeropties').style.display = 'none';
document.getElementById('optieslink').style.visibility = 'visible';
document.getElementById('optieslink').style.display = 'block';
		
document.getElementById('titeldaphne').src = basicurl + "/img/daphnegeeftraad.gif";
}
if (naar == "1") { // normale aise
document.getElementById('daphnestart').style.visibility = 'hidden';
document.getElementById('daphnestart').style.display = 'none';

document.getElementById('daphnetop').style.visibility = 'visible';
document.getElementById('daphnetop').style.display = 'block';
document.getElementById('daphnestretch').style.visibility = 'visible';
document.getElementById('daphnestretch').style.display = 'block';
document.getElementById('daphnebottom').style.visibility = 'visible';
document.getElementById('daphnebottom').style.display = 'block';
	
document.getElementById('meeropties').style.visibility = 'hidden';
document.getElementById('meeropties').style.display = 'none';
document.getElementById('optieslink').style.visibility = 'visible';
document.getElementById('optieslink').style.display = 'block';
		
//document.getElementById('titeldaphne').src = basicurl + "/img/daphnegeeftraad.gif";
}
if (naar == "2") { // aise met extra's

aise.getChatStatus("ScriptTagIDChat",aise.proxychatServer,"dreizen","false");		
		
document.getElementById('daphnestart').style.visibility = 'hidden';
document.getElementById('daphnestart').style.display = 'none';

document.getElementById('daphnetop').style.visibility = 'visible';
document.getElementById('daphnetop').style.display = 'block';
document.getElementById('daphnestretch').style.visibility = 'visible';
document.getElementById('daphnestretch').style.display = 'block';
document.getElementById('daphnebottom').style.visibility = 'visible';
document.getElementById('daphnebottom').style.display = 'block';
	
document.getElementById('meeropties').style.visibility = 'visible';
document.getElementById('meeropties').style.display = 'block';
document.getElementById('optieslink').style.visibility = 'hidden';
document.getElementById('optieslink').style.display = 'none';

document.getElementById('chatlink').href = "http://chat.d-reizen.nl/client/default.aspx?UID=" + aise.lastReceived_uid;
}
}
*/
/*********************************************************************
*********************************************************************
*********************************************************************
**********************************************************************/

//var serverPath = et_loc + "://192.168.1.34";
//var basicurl = serverPath + "";
var serverPath = et_loc + "://projecten.elitech.nl";
var basicurl = serverPath + "/dreizen/js";

var aise = new elitechAise();
aise.projectID 			= 71; //24;   /* AISE projectID in de database*/
aise.instanceName 		= 'aise';     /* deze variabele niet veranderen */
aise.defaultFromtop 	= "0px";    /* startwaarde top van aise */
aise.defaultFromLeft 	= "0px";    /*(screen.width/2) + 34 + "px" */
aise.defaultvraag[0] 	= "Wat mag ik meenemen aan bagage?";
aise.defaultvraag[1] 	= "Waar zijn de vakantie winkels van d-reizen?";
aise.handigeVragen 		= false;  	  /* Maak gebruik van handige vragen */
aise.state 				= 2;     	  /* initiële status 1 = dicht, 2 = opengeklapt, 3=met beoordeling */
aise.doPagePush 		= true; 	     /* indien false verschijnt onder het antwoord een link naar de page push pagina */
aise.proxyServer 		= basicurl + "/proxy.asp";
aise.proxychatServer 	= basicurl + "/proxychat.asp";
aise.css 				= basicurl + "/daphne_klantenservice_versie3" + ((et_loc == 'https') ? '_ssl' : '') + ".css";
aise.opmerkingUrl 		= serverPath + "/receiveopmerkingen.aspx";
aise.loadingHTML 		= "<img src='http://projecten.elitech.nl/dreizen/js/img/ajax-loader.gif' border='0' />"
aise.showDivSources 	= false;      /* Debug only => laat content van de divs in textarea's zien. Handig tijdens opmaak van div's */
aise.useIframeIEfix 	= false;  	  /* aan uitzetten IE fix => wel of geen achterliggende iframes bij de divs. Div kan anders niet over selectboxen en flash heen liggen. */
aise.testing 			= false;      /* Wel of niet weergeven van de beoordelingsdiv na het krijgen van een antwoord; als niet aan, dan dus geen status3div */
aise.feedbacktestfase 	= false;
aise.pagepushiframe 	= false;
aise.toonvraag 			= true;
aise.StandaardTekst 	= "Stel hier uw vraag kort en bondig.";
// !! in verband met de javascript code moeten de style-width/height/top/left voor de te repositioneren blokken in onderstaande code gezet worden en niet in de stylesheet.

aise.frame1 += '<div id="status1div" class="status1DivStyle" style="display:none;position:relative;z-index:1000;top:0px;left:0px;width:660px;height:auto;">';
aise.frame1 += '<div id="et_cssdaphne">';
aise.frame1 += '	<div id="daphnevrantw">';
aise.frame1 += '		<div id="daphnetop"><img src="' + basicurl + '/img/homev3_bgtop.gif" border="0" /></div>';
aise.frame1 += '		<div id="daphnestretch"><div id="divpadding">';
aise.frame1 += '			<div id="aiseResponseDiv">Als u vragen heeft over een reeds gemaakte boeking of een andere service gerelateerde vraag, stel mij dan uw vraag.</div>'; 
aise.frame1 += '			<div id="stelvraag"><textarea type="text" id="question" name="question" size="22" value="" class="tekstinput_start" onClick="javascript:doTextClick();" onKeyPress="return checkEnter(event)" onkeydown="javascript:CharTeller(document.getElementById(&#34;question&#34;),document.getElementById(&#34;vak&#34;),125);" onkeyup="javascript:CharTeller(document.getElementById(&#34;question&#34;),document.getElementById(&#34;vak&#34;),125);">' + aise.StandaardTekst + '</textarea></div>';
aise.frame1 += '			<div id="vraaginfo"><div class="tekens">U heeft nog <span id="vak">125</span> tekens</div><div id="sendvraag"><a href="#" onClick="aise.sendQuestion()"><img name="stelvraag" src="' + basicurl + '/img/steluwvraag.gif" border="0" alt="Stel uw vraag" /></a></div></div>';
aise.frame1 += '		</div></div>';
aise.frame1 += '		<div id="daphnebtm"><img src="' + basicurl + '/img/homev3_bgbtm.jpg" border="0" /></div>';
aise.frame1 += '	</div>';
aise.frame1 += '	<div id="daphnecontact">';
aise.frame1 += '		<div id="topcontact"><img src="' + basicurl + '/img/homev3_contacttop.gif" border="0" /></div>';
aise.frame1 += '		<div id="stretchcontact">';
aise.frame1 += '			<img src="' + basicurl + '/img/chatmetdreizen.gif" border="0" /><br />';
aise.frame1 += '			<div id="et_ChatOptie_online" style="display:none;visibility:hidden;">'
aise.frame1 += '				<span><p>U kunt nu chatten met een medewerker van D-reizen.</p></span>';
aise.frame1 += '				<a id="chatlink" href="javascript:void(0);" onclick="javascript:et_OpenChatWindow();" title="Start met chatten" alt="Start met chatten"><img src="' + basicurl + '/img/chatbutton.gif" border="0" /></a>';
aise.frame1 += '			</div>';
aise.frame1 += '			<div id="et_ChatOptie_offline" style="display:block;visibility:visible;">'
aise.frame1 += '				<span><p>Op dit moment is er geen mede-<br />werker van D-reizen beschikbaar<br />die u via de chat te woord kan staan.</p></span>';
aise.frame1 += '			</div>';
aise.frame1 += '			<div id="et_openingstijden"><span><br /><br /><img src="' + basicurl + '/img/belons.gif" border="0" /><br />Onze medewerkers helpen u graag bij het beantwoorden van uw vragen.<br /><br /><table border="0" class="et_tbladres"><tr><td colspan="3"><span class="et_title">Afdeling Reserveringen</span><br />(Nieuwe reservering)</td></tr><tr><td>Maandag - zaterdag</td><td>&nbsp;</td><td>08.00 - 22.00</td></tr><tr><td>Zondag</td><td>&nbsp;</td><td>10.00 - 22.00</td></tr></table><table border="0" class="et_tbladres"><tr><td colspan="3"><span class="et_title">Afdeling Service</span><br />(Bestaande reservering)</td></tr><tr><td>Maandag - vrijdag</td><td>&nbsp;</td><td>09.00 - 18.00</td></tr><tr><td>Zaterdag</td><td>&nbsp;</td><td>09.00 - 17.00</td></tr><tr><td>Zondag</td><td>&nbsp;</td><td>Gesloten</td></tr></table><br /><strong>0900-1811</strong> (0,15 epm.)<br /></span></div>';
aise.frame1 += '		</div>';
aise.frame1 += '		<div id="btmcontact"><img src="' + basicurl + '/img/homev3_contactbtm.gif" border="0" /></div>';
aise.frame1 += '	</div>';
aise.frame1 += '</div>';
aise.frame1 += '</div>';


//onload="this.style.height = document.getElementById(&#34;daphnevrantw&#34;).clientHeight - 17 + &#34;px&#34;" SEARCH OP stretchcontact, 2x aanzetten
//aise.frame1 += '			<span><br /><br /><img src="' + basicurl + '/img/belons.gif" border="0" /><br />(7 dagen per week tussen 08:00 en 22:00 uur) 0,15 cpm<br /></span>';
//<img name="Telefonisch Contact" src="' + basicurl + '/img/telefonischcontact.gif" border="0" alt="Telefonisch Contact" /><br /><br /><span class="tbladres">.

aise.frame2 += '<div id="status2div" class="status2DivStyle" style="border:0;display:none;width:0px;height:0px;">';
aise.frame2 += '</div>';

aise.frame3 += '<div id="status3div" style="position:absolute;z-index:1000;top:0px;left:0px;width:197px;height:320;display:none;">';
aise.frame3 += '<table id="tlbeoordelingsantw" cellpadding="0" cellspacing="0" border="0" width="197" height="320">';
aise.frame3 += '	<tr height="10"><td width="5" rowspan="7"></td><td width="187"></td><td width="5" rowspan="7"></td></tr>';
aise.frame3 += '	<tr height="44"><td>Geef hier per vraag aan wat u van het antwoord van Daphne vindt.</td></tr>';
aise.frame3 += '	<tr height="10"><td></td></tr>';
aise.frame3 += '	<tr height="42"><td class="lijn"><input type="radio" name="beoordeling" id="beoordelingGoed" value="Goed" onClick="aise.changeBeoordeling(0);aise.SendOpmerking();" />De vraag is goed beantwoord.</td></tr>';
aise.frame3 += '	<tr height="42"><td class="lijn"><input type="radio" name="beoordeling" id="beoordelingVerkeerdHerkend" value="Verkeerd herkend" onClick="aise.changeBeoordeling(1)" />De vraag wordt niet goed herkend.</td></tr>';
aise.frame3 += '	<tr height="42"><td class="lijn"><input type="radio" name="beoordeling" id="beoordelingFout" value="Fout" onClick="aise.changeBeoordeling(2)" />Het antwoord is inhoudelijk niet goed.</td></tr>';
aise.frame3 += '	<tr height="130"><td class="lijn">';
aise.frame3 += '		<div id="divInvoerOpmerking" style="display:none;height:100;">';
aise.frame3 += '			<table id="tlbeoordelingsantw" border="0" cellpadding="0" cellspacing="0">';
aise.frame3 += '				<tr><td height="10"></td></tr>';
aise.frame3 += '				<tr><td height="19"><div id="opmerkingtitel"></div></td></tr>';
aise.frame3 += '				<tr><td height="2"></td></tr>';
aise.frame3 += '				<tr><td height="45"><div id="divInvoerOpmerkingTextArea"><textarea id="invoerOpmerking" name="invoer" cols="20" value=""></textarea></div></td></tr>';
aise.frame3 += '				<tr><td height="22" valign="bottom"><a href="#" onMouseOver="javascript:swap(&#34;opslaan&#34;,&#34;opslaanon&#34;);" onMouseOut="javascript:swap(&#34;opslaan&#34;,&#34;opslaanoff&#34;);" onClick="aise.SendOpmerking();return false;" title="Opslaan"><img name="opslaan" src="' + basicurl + '/img/ok_off.gif" border="0" /></a></td></tr>';
aise.frame3 += '				<tr><td height="2"></td></tr>';
aise.frame3 += '			</table>';
aise.frame3 += '		</div>';
aise.frame3 += '	</td></tr>';
aise.frame3 += '</table>';
aise.frame3 += '</div>';

//if (top.window.name.indexOf(";pp=ja;") > -1) {
aise.parse(); /* Start aise */
//} else {
//	alert('Daphne wordt niet getoond.');
//}



/**********************************************************************/
/************** zie ook aise.frame1/2/3 variabelen ********************/
/**********************************************************************/
function isIE50()
{
    return isIE5() && !isIE55();
}
function isFF()
{
    return navigator.userAgent.indexOf("Firefox") > -1;
}
function isFF15()
{
    return navigator.userAgent.indexOf("Firefox/1.5") > -1;
}
function isFF20()
{
    return navigator.userAgent.indexOf("Firefox/2.0") > -1;
}
function isIE55()
{
    return navigator.userAgent.indexOf("MSIE 5.5") > -1;
}
function isIE()
{
    return navigator.userAgent.indexOf("MSIE") > -1;
}
function isIE5()
{
    return navigator.userAgent.indexOf("MSIE 5") > -1;
}
function isIE6()
{
    return navigator.userAgent.indexOf("MSIE 6") > -1 && navigator.userAgent.indexOf("Opera") == -1;
}
function isIE7()
{
    return navigator.userAgent.indexOf("MSIE 7") > -1;
}
function isGeldigeIE()
{
    return isIE55() || isIE6() || isIE7();
}
function isSAFARI()
{
    return navigator.userAgent.indexOf("Safari") > -1;
}
function isWinXP()
{
    if (navigator.userAgent.indexOf('NT 5.1') > 0)
    {
        return true;
    }
    else
    {
        return false;
    }
}

function checkEnter(e)
{
    /*versturen van de vraag indien op enter toets wordt gedrukt*/
    var key;

    document.getElementById('question').className = "tekstinput";

    if (window.event)
    {
        key = window.event.keyCode; //IE
    } else
    {
        key = e.which;              //firefox
    }
    if (key == 13)
    {
        aise.sendQuestion();
        return false;
    }
}
function move_up()
{
    /* omhoog scrollen in de Faq div */
    document.getElementById('faq').scrollTop = document.getElementById('faq').scrollTop - 15;
}
function move_down()
{
    /* omlaag scrollen in de Faq div */
    document.getElementById('faq').scrollTop = document.getElementById('faq').scrollTop + 15;
}

//startdaphneon = new Image();  startdaphneon.src = basicurl + "/img/bg_daphnestart_on.jpg";
//startdaphneoff = new Image(); startdaphneoff.src = basicurl + "/img/bg_daphnestart_off.jpg";
//uitklapon = new Image();  uitklapon.src = basicurl + "/img/uitklap2_on.gif";
//uitklapoff = new Image(); uitklapoff.src = basicurl + "/img/uitklap2_off.gif";
//opslaanon = new Image();  opslaanon.src = basicurl + "/img/ok_on.gif";
//opslaanoff = new Image(); opslaanoff.src = basicurl + "/img/ok_off.gif";
loader = new Image(); loader.src = basicurl + "/img/ajax-loader.gif";

function swap()
{
    if (document.images)
    {
        for (var x = 0; x < swap.arguments.length; x += 2)
        {
            document[swap.arguments[x]].src = eval(swap.arguments[x + 1] + ".src");
        }
    }
}

function CharTeller(field, cntdiv, maxlimit)
{
    var tel = 0;
    if (field.value.length > maxlimit)
    {
        field.value = field.value.substring(0, maxlimit);
    } else
    {
        tel = 125 - field.value.length;
        cntdiv.innerHTML = tel;
        //		if (tel >= 0 && tel <= 83)   { cntdiv.style.backgroundColor = "#ffffff"; }
        //		if (tel >= 84 && tel <= 85) { cntdiv.style.backgroundColor = "#ffffaf"; }
        //		if (tel >= 86 && tel <= 87) { cntdiv.style.backgroundColor = "#ffaf7f"; }
        //		if (tel >= 88 && tel <= 89) { cntdiv.style.backgroundColor = "#ff7f00"; }
        //		if (tel == 90)               { cntdiv.style.backgroundColor = "#ff0000"; }
    }
}

function doTextClick()
{
    if (document.getElementById('question').innerHTML == aise.StandaardTekst)
    {
        document.getElementById('question').innerHTML = "";
        CharTeller(document.getElementById('question'), document.getElementById('vak'), 125);
        document.getElementById('question').focus();
	}
}
function et_OpenChatWindow()
{
	window.open("http://chat.d-reizen.nl/client/default.aspx?UID=" + aise.lastReceived_uid, "chatWindow", "location=no");
}
function et_OpenContactWindow(url)
{
	if (url == undefined || url == '')
	{
		url = "http://www.d-reizen.nl/contact-formulier";
	}
	window.open(url, "Contactformulier", "status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=1,scrollbars=0,height=586,width=550");
}
function RemoveXSS(str) {
    str = str.replace(/>/gi, " ").replace(/</gi, " ");          // '<' en '>'.
    str = str.replace(/%3e/gi, " ").replace(/%3c/gi, " ");      // url-encodering '<' en '>'.
    str = str.replace(/&#60;/gi, " ").replace(/&#62;/gi, " ");  // html-encodering '<' en '>'.
    str = str.replace(/javascript\:/gi, " ");                   // javascript-startstring.
    str = str.replace(/document\.\S/g, " ");                    // document-startstring.
    return str;
}