function FillSetDDL(combo, tarDDL)
{
	var retArr = new Array();
	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4)
		{
			if (xmlhttp.status != 200)
			{
				alert("שגיאה!");
				return;
			}
			retArr = xmlhttp.responseText.split('^')
			populateList(retArr, tarDDL);	
			xmlhttp = null;
		}
	}
	xmlhttp.open("GET", "get_data.asp?" + combo.name + "=" + combo.value, true);
	xmlhttp.send();
}

function populateList(retArr, ddl)
{
	ddlList = document.getElementById(ddl);
	 if(retArr != "")
	 {
		 ddlList.options.length = 1;
		 for(i = 0; i< (retArr.length/2); i++) {
		  ddlList.options[i+1] = new Option(retArr[2*i+1], retArr[2*i]);
		 }
	 }
	 else
	 {
		 ddlList.length = 1;
	 }
}

function OpenWindow(src)
{
	var w = 500;
	var h = 250;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = "top=" + wint + ", left=" + winl + ", resizable=no, scrollbars=no, width="+ w + ", height="+ h;
	window.open(src, "newwindow", winprops);
}

function fixPNG(myImage, url) 
{
	var arVersion = navigator.appVersion.split("MSIE")
	var version = parseFloat(arVersion[1])
	
    if ((version >= 5.5) && (version < 7) && (document.body.filters)) 
    {
       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""
	   var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""
	   var imgTitle = (myImage.title) ? 
		             "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "
	   var imgStyle = "display:inline-block;" + myImage.style.cssText
	   var strNewHTML = "<span " + imgID + imgClass + imgTitle
                  + " style=\"" + "width:" + myImage.width 
                  + "px; height:" + myImage.height 
                  + "px;" + imgStyle + ";"
                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"><img src='images/spacer.gif' style='width:" + myImage.width + "px; height:" + myImage.height + "px; cursor:pointer;' onclick=\"window.location.href='" + url + "'\" /></span>"
	   myImage.outerHTML = strNewHTML  
    }
}
