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");
            bsel.setAttribute("class","home choose-country");
            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');
                if(blia.length > 0){
	                blistoption = blia[0].childNodes[0].nodeValue;
	                blistvalue = blia[0].href;// TODO Tester sous ie 6
	                bopt[i] = document.createElement("option");
	                bsel.appendChild(bopt[i]);
	                bopt[i].setAttribute("value", blistvalue); 
	                bopt[i].text = blistoption;
                }
            }
            if (/MSIE (\d+\.\d+);/.test(navigator.userAgent)){ //test for MSIE x.x;
            	 var ieversion=new Number(RegExp.$1) // capture x.x portion and store as a number
            	 if (ieversion==6) {
            		 bsel.setAttribute("onchange",function(){go_out_pasteur(this.value);});
            	 }
            	 else {
            		 bsel.setAttribute("onchange","if(this.value != \'\'){go_out_pasteur(this.value)};");
            	 }
            }
            /*if(navigator.appName == 'Microsoft Internet Explorer'){
            	if(navigator.appVersion == ''){ //IE6 compliant
            		bsel.setAttribute("onchange",function(){go_out_pasteur(this.value);});
            	} else { // IE8 compliant
            		bsel.setAttribute("onchange","if(this.value != \'\'){go_out_pasteur(this.value)};");
            	}
            }*/
            else{
                bsel.setAttribute("onchange", "if(this.value != \'\'){go_out_pasteur(this.value)};");
            }
            bsel.setAttribute("id", b);
            ultosel.replaceChild(bsel,bulbyid);
        }
    }
}();
            
