/* ----------------------------------------------------------------------------
Begin
---------------------------------------------------------------------------- */
var strSelect = '';

function CatX_OnChange(CatX){

var xx, match, str, cat1_value

   // 1 filtert 2
	if (CatX!='1') return;

	// eerste keer hele lijst Cat2 opslaan
	if (strSelect=='') strSelect = document.frm.Cat2.outerHTML;
	
	// pak select tag
	xx = new RegExp("<select.*?>","gi");
	str = xx.exec(strSelect);
	
	// pak alle options
	xx = new RegExp("<option.*?</option>","gi");
	cat1_value = document.frm.Cat1.value;
	
	if (cat1_value=='0') 
		document.frm.Cat2.outerHTML = strSelect;
	else {
	
		match = xx.exec(strSelect);
		while(match != null) {

			// selecteer alle options behorende bij gekozen Cat1
			if( match[0].indexOf('1:') < 0 || match[0].indexOf('1:' + cat1_value) >= 0)
				str = str + match;
			
			match = xx.exec(strSelect);
		}

		document.frm.Cat2.outerHTML = str + '</select>';
	}
}
	
/* ----------------------------------------------------------------------------
Einde
---------------------------------------------------------------------------- */

