 function my_init() {
   for (i=0;i<categories.length;i++) {
     if (categories[i] != "")
     	var opt = new Option();
	opt.value = categories[i][0];
	opt.text = categories[i][1];
	var cf_filtr =  window.document.filtr.elements["ct_filter"];
     	cf_filtr.options[cf_filtr.options.length] =   opt;
    }
   cf_filtr.options[0].Selected=true;
//
//    for (i=0;i<items.length;i++) {
//      if (items[i] != "")
//      	var opt = new Option();
// 	opt.value = items[i][0];
// 	opt.text = items[i][3];
// 	var dopeq =  window.document.filtr.elements["dopeq_" + num];
//      	dopeq.options[dopeq.options.length] =   opt;
//     }
//    dopeq.options[0].Selected=true;
   }

  function change_items_list(filter) {
    var brand_id = 0;
	var cat_sel = window.document.filtr.elements["ct_filter"];
	var cat_sel_selected = cat_sel.selectedIndex;
	var cat_id = cat_sel.options[cat_sel_selected].value;
	//alert("cat = " + cat_id  + " brand_id = " + brand_id );
	var items_sel = window.document.filtr.elements["subservice"];
	var subservice =  window.document.filtr.elements["subservice"];
	//subservice.options.length = 0;
	for (i=0;i<items.length;i++) {
		if( (brand_id == 0) && (cat_id == 0)) {
			var opt = new Option();
			opt.value = items[i][0];
			opt.text = items[i][2];
     			subservice.options[subservice.options.length] =   opt;
		} else {
			if((brand_id !=0)&&(cat_id != 0)) {
				if ((brand_id == items[i][2]) && (cat_id == items[i][1]))	{
					var opt = new Option();
					opt.value = items[i][0];
					opt.text = items[i][2];
					subservice.options[subservice.options.length] =   opt;
					}
			} else {
				if (brand_id !=0) {
					//alert(" brand_id = " + brand_id );
					if (brand_id == items[i][2])	{
						//alert(" brand_id = " + brand_id + "item = " + items[i][3] );
						var opt = new Option();
						opt.value = items[i][0];
						opt.text = items[i][2];
						subservice.options[subservice.options.length] =   opt;

					}
				} else {
					if (cat_id == items[i][1])	{
						var opt = new Option();
						opt.value = items[i][0];
						opt.text = items[i][2];
     						subservice.options[subservice.options.length] =   opt;
					}
				}
			}

		}
	}

    subservice.options[0].Selected=true;
  	return true;
  }