function ToUrl(m){window.open(m);}

var selectRef=function(){
	var b,t;
	return{
		init:function(b,t, classn, styletxt, islink, inblankpage){
			var bul,bli,blilen,blist,blistoption,blistvalue,bsel,bulbyid,ultosel,bopt,blia,i,findSelected,findSelectedValue;
			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];
				findSelectedValue = false;
				if (!islink) {
					alert(blistvalue);
					findSelected = (toString(blistvalue)).indexOf("selected");
					if (findSelected>0) {
						 alert("Selected");
						 findSelectedValue = true
						 blistvalue = (toString(blistvalue)).substring(0,findSelected-2);
					}
				}
				bopt[i] = document.createElement("option");
				bsel.appendChild(bopt[i]);
				bopt[i].setAttribute("value", blistvalue.href);
				if (findSelectedValue) bopt[i].setAttribute("selected", "selected");
				bopt[i].text = blistoption;
			}
			if (islink) {
				if (inblankpage) {
				  if(navigator.appName == 'Microsoft Internet Explorer'){bsel.setAttribute("onchange",function(){ToUrl(this.value);});}
					else{bsel.setAttribute("onchange", "if(this.value != \'\'){window.open(this.value)};");}
				} else	bsel.setAttribute("onchange", "if(this.value != \'\'){window.location = this.value};");
			}
			bsel.setAttribute("id", b);
			bsel.setAttribute("class", classn);
			bsel.setAttribute("style", styletxt);
			ultosel.replaceChild(bsel,bulbyid);
		}
	}
}();