function FunSearchOn(strSearchOn){
	document.FrmMain.IMGMinValue.style.display = 'none';
	document.FrmMain.IMGMinValue.style.visibility = 'hidden';
	document.getElementById('TXTMinValue').style.color = 'Black';
	document.FrmMain.ImgSearchString.style.display = 'none';
	document.FrmMain.ImgSearchString.style.visibility = 'hidden';
	document.getElementById('TXTSearchString').style.color = 'Black';
	if (strSearchOn == 'Price'){
			document.FrmMain.SearchOn.value = strSearchOn
			document.FrmMain.IMGMinValue.style.display = 'inline';
			document.FrmMain.IMGMinValue.style.visibility = 'visible';
			document.getElementById('TXTMinValue').style.color = '#D40A0A';
			document.getElementById('SearchString2').value = ''; 
	}
	else if (strSearchOn == 'Action_Search'){
		if (document.getElementById('SearchString2').value != '' ){
			document.FrmMain.ImgSearchString.style.display = 'inline';
			document.FrmMain.ImgSearchString.style.visibility = 'visible';
			document.getElementById('TXTSearchString').style.color = '#D40A0A';
			//document.getElementById('MinValue').value = '';
		}
	}
	else if (strSearchOn == 'Action_Search2'){
		if (document.getElementById('SearchOption2').value != '' ){
			document.FrmMain.ImgSearchString2.style.display = 'inline';
			document.FrmMain.ImgSearchString2.style.visibility = 'visible';
			document.getElementById('TXTSearchString2').style.color = '#D40A0A';
			//document.getElementById('SearchString2').value = ''; 
			//document.getElementById('MinValue').value = '';
		}
	}
}



function ChangeAction2(){
	var strAction = document.forms["FrmMain"].SearchOption2.value
	if (strAction == 'Option0'){
		document.forms["FrmMain"].setAttribute('action','http://www.kadopagina.nl/Result.asp');
	}
	else if (strAction == 'Option7'){
		document.forms["FrmMain"].setAttribute('action','http://www.kadopagina.nl/Result.asp?SearchOn=TopList&Theme=13');
	}
	else if (strAction == 'Option8'){
		document.forms["FrmMain"].setAttribute('action','Zoek_op_Trefwoord.asp');
	}
	else if (strAction == 'Option9'){
		document.forms["FrmMain"].setAttribute('action','Zoek_op_Provincie.asp');
	}
	else if (strAction == 'Option12'){
		document.forms["FrmMain"].setAttribute('action','http://www.kadopagina.nl/Alle-kados.asp');
	}
	else if (strAction == 'Option13'){
		document.forms["FrmMain"].setAttribute('action','http://www.kadopagina.nl/Result.asp?SearchOn=TopList&Theme=49');
	}
	else if (strAction == 'Option16'){
		document.forms["FrmMain"].setAttribute('action','http://www.kadopagina.nl/Result.asp?SearchOn=TopList&Theme=25');
	}
	funSubmitToResult()
}



function funSubmitToResult(){
	var strsubmitstring = "";
		strsubmitstring  = strsubmitstring + 'SearchString1='+document.forms['FrmMain'].SearchString1.value+'&';
		strsubmitstring  = strsubmitstring + 'SearchString2='+document.forms['FrmMain'].SearchString2.value+'&';

	if (window.XMLHttpRequest){// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  	}
	xmlhttp.onreadystatechange=function(){
		if (xmlhttp.readyState==4 && xmlhttp.status==200){
			document.forms['FrmMain'].submit();
			return false;
    	}
	}
	xmlhttp.open("POST","_Ajax_ClearSession.asp",true);
	xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlhttp.send(strsubmitstring);

	
}


if (document.FrmMain.SearchOn.value == 'Price'){
	document.FrmMain.IMGMinValue.style.display = 'inline';
	document.FrmMain.IMGMinValue.style.visibility = 'visible';
	document.getElementById('TXTMinValue').style.color = '#D40A0A';
}
else if (document.FrmMain.SearchOn.valuearchOn == 'Action_Search'){
	document.FrmMain.ImgSearchString.style.display = 'inline';
	document.FrmMain.ImgSearchString.style.visibility = 'visible';
	document.getElementById('TXTSearchString').style.color = '#D40A0A';
}


