
function cBoxPopUp(visibility, id)
{
    elem = document.getElementById(id);
    elem.style.visibility = visibility;
    return false;
}

function mailerPopUp(visibility, id)
{
    elem = document.getElementById(id);
    elem.style.visibility = visibility;
    elem.style.left = getWidth() / 2 -250;

    return false;
}

function stuurCheck()
{
var visSet = document.getElementById("stuur_checkbox").checked ? "visible" : "none";
document.getElementById("submit_mailer").style.display = visSet;
}

function stuurmailerPopUp(visibility, id)
{
    var email = document.getElementById("stuurmail").value;
    if ((email == null) || (email == "")) {window.alert('Vul SVP uw e-mailadres in om op de hoogte te blijven van de laatste Horizon Reizen aanbiedingen.'); return; }
    if(!email.match(/^[A-Za-z0-9\.\_]{1,32}\@[A-Za-z0-9\.\_]{1,32}\.[a-zA-Z]{2,6}$/))
    { window.alert('Incorrect e-mail!'); return false }
    else { document.getElementById("stuuremail").value = email; 
    elem = document.getElementById(id);
    elem.style.visibility = visibility;
    elem.style.left = getWidth() / 2 -250;

    return false; }
}


function checkStuur(obj){
        var checkobj = 0;
        if(obj.checked) checkobj++;
            else checkobj--;
        if (checkobj<=0) document.stuurform.elements['submit'].disabled = true;
            else document.stuurform.elements['submit'].disabled = false;
    }



function stuurmailerSend(visibility, id)
{
    var email = document.getElementById("stuuremail").value;
    var names = document.getElementById("clientNames").value;
    var surn = document.getElementById("clientSur").value;
    if ((email == null) || (email == "")) {window.alert('No email!!!'); return false }
    if ((names == null) || (names == "")) {window.alert('No Name!!!'); return false }
    if ((surn == null) || (surn == "")) {window.alert('No Surname!!!'); return false }
    if(!email.match(/^[A-Za-z0-9\.\_]{1,32}\@[A-Za-z0-9\.\_]{1,32}\.[a-zA-Z]{2,6}$/))
    { window.alert('Incorrect e-mail!'); return false }

    elem = document.getElementById(id);
    elem.style.visibility = visibility;
    elem.style.left = getWidth() / 2 -250;
    cBoxPopUpMail("visible","confirmBoxMail");
    return false; 
}


function getWidth() {

var viewportwidth;
var viewportheight;

 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight

 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }

// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }

 // older versions of IE

 else
{
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth
}
return viewportwidth;
}

