 function createXMLHttpRequest(){
   // See http://en.wikipedia.org/wiki/XMLHttpRequest
   // Provide the XMLHttpRequest class for IE 5.x-6.x:
   if( typeof XMLHttpRequest == "undefined" ) XMLHttpRequest = function() {
 try { return new ActiveXObject("Msxml2.XMLHTTP.6.0") } catch(e) {}
 try { return new ActiveXObject("Msxml2.XMLHTTP.3.0") } catch(e) {}
 try { return new ActiveXObject("Msxml2.XMLHTTP") } catch(e) {}
 try { return new ActiveXObject("Microsoft.XMLHTTP") } catch(e) {}
 throw new Error( "This browser does not support XMLHttpRequest." )
   };
   return new XMLHttpRequest();
 }

 var AJAX = createXMLHttpRequest();

 function handler() {
   if(AJAX.readyState == 4 && AJAX.status == 200) {
   var json = eval('(' + AJAX.responseText +')');
//   alert('Success. Result:'+json);
                 oSelect = document.getElementById("theme_select");
                 oSelect.options.length = 0;
//                 oSelect.options[oSelect.options.length] = new Option("Выберите область", 0);
                 for (var i=0;i<json.length;i++)
                 {
//                     alert(json[i]);
                    oSelect.options[oSelect.options.length] = new Option(json[i], json[i]);
                 }
   }else if (AJAX.readyState == 4 && AJAX.status != 200) {
 alert('Something went wrong...');
   }
 }

 function doDomains(lang_val){
   AJAX.onreadystatechange = handler;
   AJAX.open("GET", "ajax.jsp?action=getDomains&language="+lang_val);
   AJAX.send("");
 };

