function fill(combo, name, src)
{
	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4)
		{
			if (xmlhttp.status != 200)
			{
				alert("שגיאה!");
				return;
			}
			var doc = new ActiveXObject("Microsoft.XMLDOM");
			doc.async = false;
			doc.loadXML(xmlhttp.responseText);
			var nodes = doc.selectNodes("xml/rs:data/z:row");
			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].getAttribute("Name");
				combo.add(opt);
			}
			xmlhttp = null;
			doc = null;
		}
	}
	xmlhttp.open("GET", "getxml.asp?" + name + "=" + src.value, true);
//	xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	xmlhttp.send();
}

function submitSearch(obj)
{
	if (obj.Search.value == "" && obj.CategoryID.selectedIndex == 0)
	{
		alert("יש לבחור קטגוריה");
		return false;
	}
	if (obj.Search.value == "" && obj.AreaID.selectedIndex == 0)
	{
		alert("יש לבחור אזור");
		return false;
	}
	return true;
}

function redirectSearch(obj)
{
	oForm = obj.form;
	if (oForm.query.value == "")
	{
		alert("יש לרשום מילת חיפוש");
		return false;
	}
	for (i=0; i<oForm.rdSearchSite.length; i++)
		if (oForm.rdSearchSite[i].checked)
		{
			location.href = oForm.rdSearchSite[i].value + oForm.query.value;
			return true;
		}
	alert("יש לבחור מנוע חיפוש");
	return false;
}

function window.onscroll()
{
	obj = document.getElementById("sidebanner");
	if (!obj) return;
	obj.style.top = document.body.scrollTop;
	obj2 = document.getElementById("sidebanner2");
	if (!obj2) return;
	obj2.style.top = document.body.scrollTop;
}

function printPage()
{
	args = "top=100, left=100, height=500, width=700, status=no, toolbar=no, menubar=no, scrollbars=yes, location=no";
	window.open("print.asp", "Print", args);
}

function sortData(strURL, strSort)
{
	var obj = window.event.srcElement;
	if (obj.tagName == "TH")
	{
		var ID = obj.id;
		if (ID)
		{
			strURL += "&Sort=" + ID;
			if (strSort == ID)
			{
				strURL += " DESC"
			}
			window.location.replace(strURL);
		}
	}
}

function showCoupon(CouponID)
{
	var w = 400;
	var h = 320;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = "top=" + wint + ",left=" + winl + ",resizable=no,scrollbars=yes" + ",width="+ w + ",height="+ h;
	winMovie = window.open("showCoupon.asp?CouponID=" + CouponID , "popupShowCoupon" + CouponID, winprops)
	if (parseInt(navigator.appVersion) >= 4) { winMovie.window.focus(); }
}

function showMitcham(pic) {
var w = 400;
var h = 400;
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = "top=" + wint + ",left=" + winl + ",resizable=no,scrollbars=yes" + ",width="+ w + ",height="+ h;
winMovie = window.open("showMitcham.asp?Pic=" + pic , "popupMitcham", winprops)
if (parseInt(navigator.appVersion) >= 4) { winMovie.window.focus(); }
}

function showPhoto(pic,pictext) {
var w = 400;
var h = 300;
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops = "top=" + wint + ",left=" + winl + ",resizable=no,scroll=no,scrollbars=yes,width="+ w + ",height="+ h;
winMovie = window.open("showpic.asp?Pic=" + pic + "&PicText=" + pictext, "popupShowPic", winprops)
if (parseInt(navigator.appVersion) >= 4) { winMovie.window.focus(); }
}

function showMap(Map,Type) {
var w = 650;
var h = 580;
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;
winMovie = window.open("showMap.asp?Map=" + Map + "&MapType=" + Type , "popupMitchamMap", winprops)
if (parseInt(navigator.appVersion) >= 4) { winMovie.window.focus(); }
}

function sendMail(ID) {
var w = 400;
var h = 350;
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;
winMovie = window.open("sendMail.asp?MessageID=" + ID, "popupMitchamEmail", winprops)
if (parseInt(navigator.appVersion) >= 4) { winMovie.window.focus(); }
}

function showHide(id)
{
	oDiv = document.getElementById(id);
	if (oDiv)
	{
		if (oDiv.style.display == "none")
		{
			oDiv.style.display = "block";
		}
		else
		{
			oDiv.style.display = "none";
		}
	}
}