function isOpera() { 
  return navigator.userAgent.indexOf("Opera") > -1;
}
var opera = isOpera();
function jr2(){var jr3 = document.getElementsByTagName("li");if(jr3.length){for(var i=0; i < jr3.length; i++){if(jr3[i].className == "linormal"){jr3[i].onmouseover = function() {this.className = "lihover"; };jr3[i].onmouseout = function() { this.className = "linormal"; };};};};}
function noDialogShow(url,width)
    {
    var left =screen.width - (width+10);
    window.open(url, "CMS", "dependent=yes,width="+width+"px,left="+left+"px,top=0");
    }

function modelessDialogShow(url,width,height)
    {
    var left = screen.availWidth/2 - width/2;
    var top = screen.availHeight/2 - height/2;
    window.open(url, "CMS", "dependent=yes,width="+width+"px,height="+height+",left="+left+",top="+top);
    }

function pseudoFocus()
{
    var field = document.getElementsByTagName("input");
    for(var i=0; i < field.length; i++) 
    {
        if(field[i].type == "text")
        {
            field[i].onfocus = function() {this.className += "focus"; };
            field[i].onblur = function() { this.className = this.className.replace(/focus/, ""); };
        }
    }
}
window.onload=jr2;
function focusTA()
{
    var vld=document.getElementById("bericht");
    if(vld)vld.className += "focus";
}
function blurTA()
{
    var vld=document.getElementById("bericht");
    if(vld)vld.className = vld.className.replace(/focus/, "");
}
function createElm(element) {
    if (typeof document.createElementNS != 'undefined') {
        return document.createElementNS('http://www.w3.org/1999/xhtml', element);
        }
    if (typeof document.createElement != 'undefined') {
        return document.createElement(element);
        }
    return false;
}

function textareaResizer() {
    var labels = document.getElementsByTagName('label');
    for(i=0; i<labels.length; i++) {
        if(labels[i].getAttribute('title') == 'Uw bericht') {
            enlarge = createElm('a');
            enlarge.setAttribute('style', 'cursor: pointer;text-decoration:underline;');
            enlarge.onclick = function () { document.getElementById('bericht').rows += 5; }
            enlarge.setAttribute('title', 'Klik om het tekst gebied te vergroten.');
            enlarge.appendChild(document.createTextNode('Vergroot'));
            decrease = createElm('a');
            decrease.setAttribute('style', 'cursor: pointer;text-decoration:underline;');
            decrease.onclick = function () { document.getElementById('bericht').rows -= 5; }
            decrease.setAttribute('title', 'Klik om het tekst gebied te verkleinen.');
            decrease.appendChild(document.createTextNode('verklein'));

            small = createElm('small');
            small.appendChild(document.createTextNode(' ('));
            small.appendChild(enlarge);
            small.appendChild(document.createTextNode(' of '));
            small.appendChild(decrease);
            small.appendChild(document.createTextNode(' tekst gebied)'));
            labels[i].appendChild(small);
        }
    }
}
function domFunction(f, a) {
    var n = 0;
    var t = setInterval(function() {
        var c = true;
        n++;
        if(typeof document.getElementsByTagName != 'undefined' && (document.getElementsByTagName('body')[0] != null || document.body != null)) {
            c = false;
            if(typeof a == 'object') {
                for(var i in a) {
                    if((a[i] == 'id' && document.getElementById(i) == null) || (a[i] == 'tag' && document.getElementsByTagName(i).length < 1)) { 
                        c = true; 
                        break; 
                    }
                }
            }
            if(!c) { f(); clearInterval(t); }
        }
        if(n >= 60) {
            clearInterval(t);
        }
    }, 250);
};
function verstuurForm()
{
    var doc=document.forms['contact'];
    if(opera) 
    {
        if(doc)doc.onsubmit=new Function("return controleerFormOpera()");
    } else {
        if(doc)doc.onsubmit=new Function("return controleerForm()");
    }
}
function controleerForm()
{
    var doc=document.forms['contact'];
    if(doc.fnaam.value=="") {
        alert("Graag een naam invullen.\n\n[Your name is required.]")
        doc.fnaam.focus();
        return false; }
    if(doc.emeel.value=="") {
        alert("Vul a.u.b. een e-mail adres in.\n\n[Your e-mail address is required.]")
        doc.emeel.focus();
        return false; }
    if(doc.emeel.value!="") {
        var atPos = doc.emeel.value.indexOf("@")
        pPos = doc.emeel.value.indexOf(".",atPos)
        if (atPos > 0 && pPos > atPos+1)
        {  } else {
            alert("Het ingevoerde e-mail adres is niet geldig.\n\n[This email address is not valid.]");
            doc.emeel.focus();
            return false; } }
    if(doc.bericht.value=="") {
        alert("Tja... \nWat is een email zonder inhoud?\nGraag een bericht invullen.\n\n[Your comment or message please.]")
        doc.bericht.focus();
        return false; }
    return true;
}
function controleerFormOpera()
{
    var doc=document.forms['contact'];
    if(doc.fnaam.value=="") {
        alert("Graag een naam invullen.\n\n[Your name is required.]")
        return false; }
    if(doc.emeel.value=="") {
        alert("Vul a.u.b. een e-mail adres in.\n\n[Your e-mail address is required.]")
        return false; }
    if(doc.emeel.value!="") {
        var atPos = doc.emeel.value.indexOf("@")
        pPos = doc.emeel.value.indexOf(".",atPos)
        if (atPos > 0 && pPos > atPos+1)
        {  } else {
            alert("Het ingevoerde e-mail adres is niet geldig.\n\n[This email address is not valid.]");
            doc.emeel.select();
            return false; } }
    if(doc.bericht.value=="") {
        alert("Tja... \nWat is een email zonder inhoud?\nGraag een bericht invullen.\n\n[Your comment or message please.]")
        return false; }
    return true;
}


// --------------------------------------- //
var dMW="200px";
var ie5=document.all && !window.opera;
var ns6=document.getElementById;
if (ie5||ns6)
document.write('<div id="popitmenu" onmouseover="clearhidemenu();" onmouseout="dynamichide(event)"></div>');
document.write('<div id="popitmenu2"></div>');

function iecompattest(){return (document.compatMode && document.compatMode.indexOf("CSS")!=-1)? document.documentElement : document.body;}
function showmenu(e, which, optWidth){
if (!document.all&&!document.getElementById){
return;
clearhidemenu();}
menuobj=ie5? document.all.popitmenu : document.getElementById("popitmenu");
menuobj2=ie5? document.all.popitmenu2 : document.getElementById("popitmenu2");
menuobj.innerHTML=which;
menuobj2.innerHTML=which;
menuobj.style.width=(typeof optWidth!="undefined")? optWidth : dMW;
menuobj.contentwidth=menuobj.offsetWidth;
menuobj.contentheight=menuobj.offsetHeight;
menuobj2.style.width=(typeof optWidth!="undefined")? optWidth : dMW;
menuobj2.contentwidth=menuobj2.offsetWidth;
menuobj2.contentheight=menuobj2.offsetHeight;
eventX=ie5? event.clientX : e.clientX;
eventY=ie5? event.clientY : e.clientY;
var rightedge=ie5? iecompattest().clientWidth-eventX : window.innerWidth-eventX;
var bottomedge=ie5? iecompattest().clientHeight-eventY : window.innerHeight-eventY;
if (rightedge<menuobj.contentwidth) {
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj.contentwidth+"px" : window.pageXOffset+eventX-menuobj.contentwidth+"px"
menuobj2.style.left=ie5? iecompattest().scrollLeft+eventX-menuobj2.contentwidth+3+"px" : window.pageXOffset+eventX-menuobj2.contentwidth+3+"px"
} else {
menuobj.style.left=ie5? iecompattest().scrollLeft+eventX+"px" : window.pageXOffset+eventX+"px"
menuobj2.style.left=ie5? iecompattest().scrollLeft+eventX+3+"px" : window.pageXOffset+eventX+3+"px"
}
if (bottomedge<menuobj.contentheight) {
menuobj.style.top=ie5? iecompattest().scrollTop+eventY-menuobj.contentheight+"px" : window.pageYOffset+eventY-menuobj.contentheight+"px"
menuobj2.style.top=ie5? iecompattest().scrollTop+eventY-menuobj2.contentheight+3+"px" : window.pageYOffset+eventY-menuobj2.contentheight+3+"px"
} else {
menuobj.style.top=ie5? iecompattest().scrollTop+event.clientY+"px" : window.pageYOffset+eventY+"px"
menuobj.style.visibility="visible"
menuobj2.style.top=ie5? iecompattest().scrollTop+event.clientY+3+"px" : window.pageYOffset+eventY+3+"px"
menuobj2.style.visibility="visible"
}
return false;
}

function contains_ns6(a, b) {
//Determines if 1 element in contained in another- by Brainjar.com
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}

function hidemenu()
{
    if (window.menuobj)menuobj.style.visibility="hidden";
    if (window.menuobj2)menuobj2.style.visibility="hidden";
}

function dynamichide(e)
{
    if (ie5&&!menuobj.contains(e.toElement)) {hidemenu(); } 
    else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)) {hidemenu();} else {}
}

function delayhidemenu(){
delayhide=setTimeout("hidemenu()",500);
}

function clearhidemenu(){
if (window.delayhide)
clearTimeout(delayhide);
}

if (ie5||ns6)
document.onclick=hidemenu;

// --------------------------------------- //


// Make sure we are in the frameset
    if (window.enable_frame &&  enable_frame == true) {       
        if( (top == self) )
        {
            var forward_url;
            forward_url = self.location;
            forward_url = forward_url+"";
            forward_url = urlencode(forward_url); 
            top.location.replace(root+'home.php?url='+forward_url);
        }
    }


function urlencode(strText)
{
    var trimReg;
    var re;
    if( typeof(strText) == "string" )
    {
        if( strText != "" )
        {
            trimReg = /(^\s+)|(\s+$)/g;
            strText = strText.replace( trimReg, '');
            strText = escape(strText);
        }
    }
    return strText;
}




























var foobar = new domFunction(function() {
    pseudoFocus();
    textareaResizer();
    verstuurForm();
    });

