function selector(deze,id) {
	tel=1;
	while(document.getElementById("select_"+tel+"_option")) {
		if(tel!=id) {
			document.getElementById("select_"+tel+"_option").style.display="none";
		}
		tel++;
	}
	
	status=document.getElementById("select_"+id+"_option").style.display;
	if(status=="block") {
		document.getElementById("select_"+id+"_option").style.display="none";
	} else if(status=="none"){
		document.getElementById("select_"+id+"_option").style.display="block";
	} else {
		document.getElementById("select_"+id+"_option").style.display="block";
	}
}

function deselector(deze,id) {
	if(document.getElementById("select_"+id+"_option")) {
		document.getElementById("select_"+id+"_option").style.display="none";
	}
}

function select_this(deze,id) {
	document.getElementById("select_"+id+"_link").innerHTML=deze.innerHTML;
	document.getElementById("select_"+id+"_option").style.display="none";
}

function catchselect() {
	 if (document.addEventListener) {  // DOM Level 2 Event Model
        // Register capturing event handlers
        document.addEventListener("click", handle, true);
    }
    else if (document.attachEvent) {  // IE 5+ Event Model
        // In the IE event model, we can't capture events, so these handlers
        // are triggered only if the event bubbles up to them.
        // This assumes that there aren't any intervening elements that
        // handle the events and stop them from bubbling.
        document.attachEvent("onclick", handle);
    }
    else {  // IE 4 Event Model
        // In IE 4 we can't use attachEvent( ), so assign the event handlers
        // directly after storing any previously assigned handlers, so they 
        // can be restored. Note that this also relies on event bubbling.
        var oldmovehandler = document.onclick
        document.onclick = moveHandler;
    }

	//if (!e) e = window.event; 
	/*if(event) {
		
		
		window.captureEvents(event.click);
		
	} else*/
	/*if(window.event) {
		
		
		window.captureEvents(window.event.click);
		
	} else if(Event) {
		window.captureEvents(Event.CLICK);
	}
	window.onclick= handle;*/
}


function handle(e) {
  //alert(e.target.id);
  var browser=navigator.appName;
	var b_version=navigator.appVersion;
	var version=parseFloat(b_version);
	
  
  //alert(this.tagName);
  //var theTarget = e.target ? e.target : e.srcElement;
  //alert(theTarget.id);
  if ((browser=="MSIE"||browser=="Microsoft Internet Explorer")){
		if (!e) var e = window.event;
		
	if(e.srcElement.id=="") {
		  deze="";
		  deselector(deze,"1");
		 deselector(deze,"2");
	  }
	
} else {
		  if(e.target.id!="select_1_link" && e.target.id!="select_2_link" && e.target.id!="select_1_option" && e.target.id!="select_2_option") {
			  deze="";
			  deselector(deze,"1");
			 deselector(deze,"2");
		  }
	}
  return true; // i.e. follow the link
}
