function fillTypeSpecLists() {	frm = document.forms[0];	checked0 = frm.searchtype[0].checked // projecten	checked1 = frm.searchtype[1].checked // initiatives	checked2 = frm.searchtype[2].checked // literature	checked3 = frm.searchtype[3].checked // other resources, materials	checked4 = frm.searchtype[4].checked // contacts	checked5 = frm.searchtype[5].checked // organisations	if ((checked0 || checked1 ) && checked4 && !checked5   ) {		// zowel projects/initiatives als contacts 		fillOptions('organisation', orgCP,  orgCPEnc, orgDefault)		fillOptions('country', countryCP, countryCPEnc, countryDefault)	}	if (!checked0 && !checked1 && checked4 && checked5   ) {		// zowel contacts als organisations		fillOptions('organisation', orgCO,  orgCOEnc, orgDefault)		fillOptions('country', countryCO, countryCOEnc, countryDefault)	}	if ((checked0 || checked1 ) && !checked4 && checked5   ) {		// zowel organisations als projects		fillOptions('organisation', orgOP,  orgOPEnc, orgDefault)		fillOptions('country', countryOP, countryOPEnc, countryDefault)	}	if ((checked0 || checked1) && !checked4 && !checked5  ) {		// alleen projects		fillOptions('organisation', orgProjects, orgProjectsEnc, orgDefault)		fillOptions('country', countryProjects, countryProjectsEnc, countryDefault)	}	if (!checked0 && !checked1 && checked4 && !checked5 ) {		// alleen contacts		fillOptions('organisation', orgContacts, orgContactsEnc, orgDefault)		fillOptions('country', countryContacts, countryContactsEnc, countryDefault)	}	if (!checked0 && !checked1 && !checked4 && checked5 ) {		// alleen organisations		fillOptions('organisation', orgOrganisations, orgOrganisationsEnc, orgDefault)		fillOptions('country', countryOrganisations, countryOrganisationsEnc, countryDefault)	}	if ((checked0 || checked1 ) && checked4 && checked5   ) {		// zowel organisations als projects als contacts		fillOptions('organisation', orgAll,  orgAllEnc, orgDefault)		fillOptions('country', countryAll, countryAllEnc, countryDefault)	}}function fillSubdomains() {	frm = document.forms[0];	obj = frm.domains;	objSub = frm.subdomains;	strvalue = obj.options[obj.options.selectedIndex].text;	subArray = new Array();	subArray = domainArray[strvalue];	objSub.options.length=0;	if (strvalue !== "") {		for( var i=0;i<subArray.length;i++){ 			objSub.options[i] = new Option( subArray[i],subArray[i]);		}	}}function showSubagegroups() {	frm = document.forms[0];	obj = frm.domains;	strvalue = obj.options[obj.options.selectedIndex].text;	c2 =  document.getElementById('cfields2');	plc2 =  document.getElementById('plcfields2');		if (frm.searchtype.type !== "hidden") {		checked0 = frm.searchtype[0].checked // projecten		checked1 = frm.searchtype[1].checked // initiatives		checked2 = frm.searchtype[2].checked // literature		checked3 = frm.searchtype[3].checked // other resources, materials		checked4 = frm.searchtype[4].checked // contacts		checked5 = frm.searchtype[5].checked // organisations	}		if (frm.searchtype.type == "hidden" ) {		if (strvalue=="Child safety" && frm.searchtype.value == "Contacts") {			showDiv(c2);			hideDiv(plc2);		}		if (frm.searchtype.value == "Contacts") {			hideDiv(c2);			showDiv(plc2);		}	}else {		if (strvalue == "Child safety" && !checked0 && !checked1 && !checked2 && !checked3 && !checked5 && checked4 ) {			showDiv(c2);			hideDiv(plc2);		} else {			hideDiv(c2);			showDiv(plc2);		}		}}function fillOptions( targetField, newValues, newValuesEnc, strdefault ){	var objField = document.getElementById(targetField);	objField.options.length=0;	objField.options[objField.options.length] = new Option( '','');	for( var i=0;i<newValues.length;i++){ 		objField.options[i+1] = new Option( newValues[i],newValuesEnc[i]);		if (newValuesEnc[i] == strdefault) {			objField.options[i+1].selected = true;		}	}}function showhidefields() {	frm = document.forms[0];	lit = document.getElementById('literaturefields')	proj = document.getElementById('projectfields')	//c =  document.getElementById('cfields')	c2 =  document.getElementById('cfields2')	pl1 =  document.getElementById('plfields')	pl2 =  document.getElementById('plfields2')	pco =  document.getElementById('pcofields')	pc2 =  document.getElementById('pcfields2')	plc =  document.getElementById('plcfields')	plc2 =  document.getElementById('plcfields2')		checked0 = frm.searchtype[0].checked // projecten	checked1 = frm.searchtype[1].checked // initiatives	checked2 = frm.searchtype[2].checked // literature	checked3 = frm.searchtype[3].checked // other resources, materials	checked4 = frm.searchtype[4].checked // contacts	checked5 = frm.searchtype[5].checked // organisations	// alleen projecten	if ((checked0 || checked1) && !checked2 && !checked3 && !checked4 && !checked5) {	//alert( 'p');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		showDiv(proj);		showDiv(pl1);		showDiv(pl2);		showDiv(pco);		showDiv(pc2);		showDiv(plc);		showDiv(plc2);	} // alleen literature	else if ((!checked0 && !checked1 && !checked4 && !checked5) && (checked2 || checked3) ) {		//alert( 'l');		showDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		showDiv(pl1);		showDiv(pl2);		hideDiv(pco);		hideDiv(pc2);		showDiv(plc);		showDiv(plc2);	} // alleen contacts	else if (!checked0 && !checked1 && !checked2 && !checked3 && checked4 && !checked5) {		//alert( 'c');		hideDiv(lit);		//showDiv(c);		showDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		showDiv(pco);		showDiv(pc2);		showDiv(plc);				showDiv(plc2);	} 	// alleen organisations	else if (!checked0 && !checked1 && !checked2 && !checked3 && !checked4 && checked5) {		//alert( 'o');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		showDiv(pco);		hideDiv(pc2);		hideDiv(plc);				hideDiv(plc2);			} // projecten & literature 	else if ((checked0 || checked1) && ( checked2 || checked3) && !checked4 && !checked5) {		//alert( 'pl');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		showDiv(pl1);		showDiv(pl2);		hideDiv(pco);		hideDiv(pc2);		showDiv(plc);				showDiv(plc2);		} // projecten & contacts	else if ((checked0 || checked1) && !checked2 && !checked3 && checked4 && !checked5) {		//alert( 'pc');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		showDiv(pco);		showDiv(pc2);		showDiv(plc);		showDiv(plc2);		} // projecten & organisaties	else if ((checked0 || checked1) && !checked2 && !checked3 && !checked4 && checked5) {		//alert( 'po');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		showDiv(pco);		hideDiv(pc2);		hideDiv(plc);		hideDiv(plc2);		} // literature & contacts	else if ((!checked0 && !checked1 && checked4 && !checked5) && (checked2 || checked3 )) {		//alert( 'lc');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		hideDiv(pco);		hideDiv(pc2);		showDiv(plc);		showDiv(plc2);		} // literature & organisations	else if (!checked0 && !checked1 && (checked2 || checked3 ) && !checked4 && checked5 ) {		//alert( 'lo');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		hideDiv(pco);		hideDiv(pc2);		hideDiv(plc);		hideDiv(plc2);		} // contacts & organisations	else if (!checked0 && !checked1 && !checked2 && !checked3 && checked4 && checked5 ) {		//alert( 'co');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		showDiv(pco);		hideDiv(pc2);		hideDiv(plc);		hideDiv(plc2);		} // projecten & literature & organisaties	else if ((checked0 || checked1) && ( checked2 || checked3) && !checked4 && checked5) {		//alert( 'plo');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		hideDiv(pco);		hideDiv(pc2);		hideDiv(plc);				hideDiv(plc2);		} // projecten & literature & contacts	else if ((checked0 || checked1) && ( checked2 || checked3) && checked4 && !checked5) {		//alert( 'plc');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		hideDiv(pco);		hideDiv(pc2);		showDiv(plc);				showDiv(plc2);		} // projecten & contacts & organisaties	else if ((checked0 || checked1) &&  !checked2 && !checked3 && checked4 && checked5) {		//alert( 'pco');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		showDiv(pco);		hideDiv(pc2);		hideDiv(plc);				hideDiv(plc2);		} // literature & contacts & organisaties	else if (!checked0  && !checked1 &&  (checked2 || checked3) && checked4 && checked5) {		//alert( 'lco');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		hideDiv(pco);		hideDiv(pc2);		hideDiv(plc);				hideDiv(plc2);		} // niets	else if (!checked0 && !checked1 && !checked2 && !checked3 && !checked4 && !checked5) {		//alert( '');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		hideDiv(pco);		hideDiv(pc2);		hideDiv(plc);		hideDiv(plc2);		} // alles	else if ((checked0 || checked1) && (checked2 || checked3) && checked4 && checked5) {		//alert( 'plco');		hideDiv(lit);		//hideDiv(c);		hideDiv(c2);		hideDiv(proj);		hideDiv(pl1);		hideDiv(pl2);		hideDiv(pco);		hideDiv(pc2);		hideDiv(plc);		hideDiv(plc2);		} }function submitthis() {	//todo: valideren dat er wel iets is gekozen voor het gesumbit mag worden	frm = document.forms[0];	return true;}function EmptyKeywords() {	document.forms[0].keywords.value = "";	myspan = 	document.getElementById("spankeywords");	myspan.innerText ="";}function hideDiv(obj) {		obj.style.visibility = "hidden";		obj.style.display = "none";}function showDiv(obj) {		obj.style.visibility = "visible";		obj.style.display = "inline";}function unique(a) {	tmp = new Array(0);	for(i=0;i<a.length;i++){		if(!contains(tmp, a[i])){			tmp[tmp.length]=a[i];			tmp.length+=1;					}	}	return tmp;}function contains(a, e) {	for(j=0;j<a.length;j++)if(a[j]==e)return true;	return false;}
