
function ToUrl(m){window.open(m);}

var selectRef=function(){
	var b,t;
	return{
		init:function(b,t){
			var bul,bli,blilen,blist,blistoption,blistvalue,bsel,bulbyid,ultosel,bopt,blia,i;
			bul=document.getElementById(b);
			bli=bul.getElementsByTagName('li');
			blilen = bli.length;
			var txt="<select style='float:left; width:auto; color:#ff0000; background:#f4f4f4; font-size:13px; border:1px solid #444; padding:3px; font-weight:normal; color:#003399' id='new_" + b +"' onchange=\"window.location = document.getElementById('new_" + b +"').value\">"
			//bsel = document.createElement("select");
			bulbyid = document.getElementById(b);
			ultosel = bulbyid.parentNode;
			
			for(i=0;i<blilen;i++){
				situ = bli[i];
				blia = bli[i].getElementsByTagName('a');
				blistoption = blia[0].childNodes[0].nodeValue;
				blistvalue = blia[0];

				txt+="<option value='" + blistvalue + "'>" + blia[0].childNodes[0].nodeValue +"</option>"

			}
			txt+="</select>"
			document.getElementById(b).innerHTML = txt;
			//bsel.setAttribute("id", b);
			//bsel.setAttribute("onchange", "window.location = document.getElementById('" + b + "').options[document.getElementById('" + b + "').selectedIndex].value;");
			
		
		}
	}
}();





/*
function ToUrl(m){window.open(m);}

var selectRef=function(){
	var b,t;
	return{
		init:function(b,t){
			var bul,bli,blilen,blist,blistoption,blistvalue,bsel,bulbyid,ultosel,bopt,blia,i;
			bul=document.getElementById(b);
			bli=bul.getElementsByTagName('li');
			blilen = bli.length;
			bsel = document.createElement("select");
			bulbyid = document.getElementById(b);
			ultosel = bulbyid.parentNode;
			if(t != ''){
				bopt = document.createElement("option");
				bsel.appendChild(bopt);
				bopt.setAttribute("value", "");
				bopt.text = t;
			}
			for(i=0;i<blilen;i++){
				situ = bli[i];
				blia = bli[i].getElementsByTagName('a');
				blistoption = blia[0].childNodes[0].nodeValue;
				blistvalue = blia[0];
				bopt[i] = document.createElement("option");
				bsel.appendChild(bopt[i]);
				bopt[i].setAttribute("value", blistvalue);
				bopt[i].text = blistoption;
			}
			if(navigator.appName == 'Microsoft Internet Explorer'){bsel.setAttribute("onchange",function(){ToUrl(this.value);});}
			else{bsel.setAttribute("onchange", "if(this.value != \'\'){window.location=this.value,_self};");}
			bsel.setAttribute("id", b);
			ultosel.replaceChild(bsel,bulbyid);
		}
	}
}();
*/
