var frames=new Array();
var frameaction=new Array();
var frameid=1;
var framecount=9;
var lastaction=-1;
var welkeframe=0;
var xml2;
var cachetime2=10;
var xmlData2;


function openanders(id,waarde,nu) {
	if(document.getElementById(id)) {
		if(waarde==nu) {
			document.getElementById(id).style.display="block";
		} else {
			document.getElementById(id).style.display="none";
		}
	}
}

function overmenen(id,waarde,nu) {
	if(nu=="deelnemer" && id=="bedrijf") {
		//alert("!");
		copyinput("p_initials","c_initials");
		copyinput("p_firstname","c_firstname");
		copyinput("p_infix","c_infix");
		copyinput("p_surname","c_surname");
		copyinput("p_sex","c_sex");
		copyinput("p_function","c_function");
		copyinput("p_solution","c_solution");
		
		copyinput("p_postal_code","c_postal_code");
		copyinput("p_housenumber","c_housenumber");
		copyinput("p_housenumberadd","c_housenumberadd");
		copyinput("p_street","c_street");
		copyinput("p_city","c_city");
		copyinput("p_country","c_country");
		
		copyinput("p_phone","p_phonework");
		copyinput("p_phone","c_phone");
		copyinput("p_email","p_emailwork");
		copyinput("p_mobile","c_mobile");
		copyinput("p_fax","c_fax");
		
		copyinput("p_department","c_department");
	} else if(nu=="deelnemer" && id=="factuur") {
		//alert("!");
		copyinput("p_initials","r_initials");
		copyinput("p_firstname","r_firstname");
		copyinput("p_infix","r_infix");
		copyinput("p_surname","r_surname");
		copyinput("p_sex","r_sex");
		copyinput("p_function","r_function");
		copyinput("p_solution","r_solution");
		
		copyinput("p_postal_code","r_postal_code");
		copyinput("p_housenumber","r_housenumber");
		copyinput("p_housenumberadd","r_housenumberadd");
		copyinput("p_street","r_street");
		copyinput("p_city","r_city");
		copyinput("p_country","r_country");
		
		copyinput("p_phone","r_phone");
		copyinput("p_email","r_email");
		copyinput("p_mobile","r_mobile");
		copyinput("p_fax","r_fax");
		
		copyinput("p_department","r_department");
	} else if(nu=="bedrijf" && id=="factuur") {
		//alert("!");
		
		
		
		copyinput("c_company","r_invoice_name");
		copyinput("c_department","r_department");
		
		
		copyinput("c_initials","r_initials");
		copyinput("c_firstname","r_firstname");
		copyinput("c_infix","r_infix");
		copyinput("c_surname","r_surname");
		copyinput("c_sex","r_sex");
		copyinput("c_function","r_function");
		copyinput("c_solution","r_solution");
		
		copyinput("c_postal_code","r_postal_code");
		copyinput("c_housenumber","r_housenumber");
		copyinput("c_housenumberadd","r_housenumberadd");
		copyinput("c_street","r_street");
		copyinput("c_city","r_city");
		copyinput("c_country","r_country");
		
		copyinput("p_phonework","r_phone");
		copyinput("p_emailwork","r_email");
		copyinput("c_mobile","r_mobile");
		copyinput("c_fax","r_fax");
		
	} else {
		//alert("?");	
	}
}

function copyinput(from,to) {
	if(document.getElementById(from)) {
		fv=document.getElementById(from).value;
		//alert("go:"+fv);
		if(document.getElementById(to)) {
			document.getElementById(to).value=fv;
			//alert("ok");
		}
	} else {
		//alert("failed");
	}
}


function faq(tag,welke) {
	faqs=document.getElementsByTagName('ul');
	for(a=0; a<faqs.length; a++) {
		if(document.getElementById(tag+""+a)) {
			document.getElementById(tag+""+a).style.display="none";
		}
	}
	document.getElementById(tag+""+welke).style.display="block";
}

function maxgo(deze,maximum,id,soort) {
	waarde=deze.value;
	var o=99;
	if(soort=="maand") {
		o=1;
	} else if(soort=="dag") {
		o=3;
	} else {
		o=99;
	}
	waarde=parseInt(waarde);
	if(waarde>0) {
		deze.value=waarde;
	} else {
		 if(soort=="bedrag") {
			deze.value="10";
			waarde=10;
		} else {
			deze.value="";
			waarde=0;
		}
	}
	waarde=waarde+"";
	//alert(o);
	//alert(((waarde.substring(0,1))*1));
	var currentTime = new Date()
	var month = currentTime.getMonth() + 1
	var day = currentTime.getDate()
	var year = currentTime.getFullYear()
	if(soort=="maand" && (waarde*1)>12) {
		alert("De ingevoerde waarde voor de maand is onjuist.");
		deze.focus();
		deze.select();
	} else if(soort=="dag" && (waarde*1)>31) {
		alert("De ingevoerde waarde voor de dag is onjuist.");
		deze.focus();
		deze.select();
	} else if(soort=="jaar2" && ((waarde*1)<1880)) {
		//alert("De ingevoerde waarde voor het jaar is onjuist.");
		waarde=waarde+"";
		if(waarde.length==2) {
			deze.value="19"+waarde;
			if(soort=="jaar" && ((waarde*1)>year)) {
				alert("De ingevoerde waarde voor het jaar is onjuist.");
			}
		} else {
				alert("De ingevoerde waarde voor het jaar is onjuist.");
		}
		
		deze.focus();
		deze.select();
	} else if(soort=="jaar" && ((waarde*1)>year)) {
		alert("De ingevoerde waarde voor het jaar is onjuist.");
		deze.focus();
		deze.select();
	} else if(soort=="huisnummer" && (waarde*1)>999999) {
		alert("De ingevoerde waarde voor het huisnummer is onjuist.");
		deze.focus();
		deze.select();
	} else if(soort=="bedrag" && (waarde*1)>9999999999) {
		alert("De ingevoerde waarde voor het bedrag is onjuist.");
		deze.value="10";
		deze.focus();
		deze.select();
	} else if(waarde.length>=maximum || (((waarde.substring(0,1))*1)>o && waarde.substring(0,1)!="")) {
		if(document.getElementById(id)) {
			document.getElementById(id).focus();
			document.getElementById(id).select();	
		}
	}
}

function checkmax(deze,maximum) {
	waarde=deze.value;
	if(waarde.length>maximum) {
		waarde=substr(waarde,0,maximum);
	}
	deze.value=waarde;
}

function sh(id) {
	if(document.getElementById(id)) {
		dp=document.getElementById(id).style.display;
		switch(dp+"") {
			case "none": document.getElementById(id).style.display="block"; break;
			case "block": document.getElementById(id).style.display="none"; break;
			case "": document.getElementById(id).style.display="block"; break;
		}
	} else {
		alert(id);	
	}
}



        function CheckForm()
        {
            if(!document.callme.naam.value>'') {
                alert("U bent vergeten uw naam in te vullen!");
                document.callme.naam.focus();
                return false;
            }
            if(!document.callme.telefoon.value>'') {
                alert("U bent vergeten uw telefoonnummer in te vullen!");
                document.callme.telefoon.focus();
                return false;
            }
            if(!document.callme.bedrijfsnaam.value>'') {
                alert("U bent de naam van uw bedrijf vergeten in te vullen!");
                document.callme.bedrijfsnaam.focus();
                return false;
            }
        }
   