function fill(combo, name, val)
{
	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4)
		{
			if (xmlhttp.status != 200)
			{
				alert("שגיאה! - " + xmlhttp.status);
				return;
			}
			var doc = new ActiveXObject("Microsoft.XMLDOM");
			doc.async = false;
			doc.loadXML(xmlhttp.responseText);
			var nodes = doc.selectNodes("//Data/Item");
			combo.length = 1;
			for (i=0; i < nodes.length; i++)
			{
				var opt = document.createElement("OPTION");
				opt.value = nodes[i].getAttribute("ID");
				opt.text = nodes[i].text;
				combo.add(opt);
			}
			xmlhttp = null;
			doc = null;
		}
	}
	xmlhttp.open("GET", "admin/getxml.asp?" + name + "=" + val, true);
	//xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlhttp.send();
}

function xmlHttpAx() // Make xml request
{
   var xmlHttp = null;
   try { 
       // Firefox, Opera 8.0+, Safari
       xmlHttp=new XMLHttpRequest();
   }
   catch (e) {
       // Internet Explorer
       try { 
           xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); 
       }
       catch (e) {
          try { 
              xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
          }
          catch (e) {
              alert("Your browser does not support AJAX!");
              return false;
          }
       }
    }
    return xmlHttp;
}

function openPage(url)
{
	var w = 785;
	var h = 550;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	args = "top=0,left=" + winl + ",status=no, toolbar=no, menubar=no, scrollbars=yes, location=nos" + ",width="+ w + ",height="+ h;
	window.open(url, "popupPage", args);
}

