﻿standaardTekst = "Typ hier jouw zoektermen";

function sendQuestion() {
    el = document.getElementById('et_askquestion');
    url = "http://kpn-customer.custhelp.com/cgi-bin/kpn_customer.cfg/php/enduser/std_alp.php?p_search_text=";
    val = el.value
//    window.open (url+val,"mywindow","menubar=no,resizable=yes,scrollbars=yes,width=640,height=640");
    window.location = url+val;
};

document.write('<div class="kpn-box boxwidth_single boxheight_small faq_rightbox">');
document.write('<textarea onkeypress="return checkEnter2(event);" onfocus="javascript:doTextClick(this);" class="tekstinput_start" value="" name="et_askquestion" id="et_askquestion" type="text">Typ hier jouw zoektermen</textarea>');
document.write('<div class="kpnnavelement"><a class="buttongrey buttonbottom" title="verstuur je vraag" href="javascript:void(0);" onclick="javascript:sendQuestion(); return false;"><span>verstuur je vraag</span></a></div>');
document.write('</div>');

function checkEnter2(e) {
    /*versturen van de vraag indien op enter toets wordt gedrukt*/
    var key;

    document.getElementById('et_askquestion').className = "tekstinput_start";

    if (window.event) {
        key = window.event.keyCode; //IE
    } 
    else {
        key = e.which; 		  //firefox
    }
    if (key == 13) {
        sendQuestion();
        return false;
    }
};

//function doTextClick() {
//    if (document.getElementById('et_askquestion').innerHTML == standaardTekst) {
//        document.getElementById('et_askquestion').innerHTML = "";
//        document.getElementById('et_askquestion').focus();
//    }
//};
function doTextClick(obj) {
    var prefill = obj.innerHTML;
    
    if (obj.innerHTML == prefill) {
        obj.innerHTML = "";
        obj.focus();
    }
};
