// e-mailadres omzetten van naam_1_domein_2_extentie naar naam@domein.extentie
// aanroep: safeContact('info_1_evalue8_2_nl')
function safeContact (address, type)
{
    // _1_ = @
    var at    = "@";
    var at2   = "_1_";
    
    // _2_ = .
    var punt  = ".";
    var punt2 = "_2_";
    
	address = address.replace(at2, at);
	address = address.replace(punt2, punt);
    
    var mail = "mailto";
    
    if (type=="image")
    {
        document.write("<DIV ONCLICK=\"parent.location='"+mail+":"+address+"'\" style=\"cursor:pointer;\"><img src=\"images/stuur-email.gif\" border=\"0\" alt=\"e-mail\"></DIV>");
    }
    else if (type=="text")
    {
        document.write("<DIV style=\"text-decoration:underline;cursor:pointer;\" ONCLICK=\"parent.location='"+mail+":"+address+"'\">Stuur e-mailbericht</DIV>");
    }
}

// Optellen van prijzen (keurmerk aanvragen)
function UpdatePrice (myForm, pricePerYear)
{
    pricePerYear = parseInt(pricePerYear);
    price=0;
    theForm = document.getElementById(myForm);
    for (i=0;i<theForm.length;i++)
    {
        if (theForm[i].type=="checkbox" && theForm[i].checked==true)
        {
            document.getElementById('td'+theForm[i].name).innerHTML = "&euro; "+pricePerYear+",00";
            price = price + pricePerYear;
            //alert(theForm[i].name);
        }
        else if (theForm[i].type=="checkbox")
        {
            document.getElementById('td'+theForm[i].name).innerHTML = "&euro; 0,00";
        }
    }
    document.getElementById('tdTotalPrice').innerHTML = "&euro; "+price+",00";
}

// Het tonen van een popup
function popup(url,winName,W,H,X,Y) {
	if(W == undefined) W = 400;	//default width
	if(H == undefined) H = 300; //default height
	if(X == undefined) X = screen.width/2-W/2; //default Xpos (is now centered)
	if(Y == undefined) Y = screen.height/2-H/2; //default Ypos (is now centered)

	winprops = 'height='+H+',width='+W+',top='+X+',left='+Y+',scr  ollbars=no';

	win = window.open(url, winName, winprops);
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}
