function fill(combo, name, src)
{
	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("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 redirectSearch()
{
	oForm = document.searchPortals;
	if (oForm.query.value == "")
	{
		alert("יש לרשום מילת חיפוש");
		return false;
	}
	for (i=0; i<oForm.rdSearchSite.length; i++)
		if (oForm.rdSearchSite[i].checked)
		{
			window.open(oForm.rdSearchSite[i].value + oForm.query.value);
			return true;
		}
	alert("יש לבחור מנוע חיפוש");
	return false;
}

function btnSubmit_Click(oForm)
{
	oForm.submit();
}

function window.onscroll()
{
	obj = document.getElementById("sidebanner");
	if (!obj) return;
	obj.style.top = document.body.scrollTop;
}

function printPage()
{
	args = "top=100, left=100, height=570, width=700, status=no, toolbar=no, menubar=no, scrollbars=yes, location=no";
	window.open("print.asp", "Print", args);
}

function overData()
{
	var obj = window.event.srcElement;
	if (obj.tagName == "TD")
	{
		if (obj.parentElement.className.indexOf("click") < 0)
			obj.parentElement.className += " over";
	}
	else if (obj.tagName == "TH")
	{
		obj.className = "over";
	}
}

function outData()
{
	var obj = window.event.srcElement;
	if (obj.tagName == "TD")
	{
		if (obj.parentElement.className.indexOf("over") > 0)
			obj.parentElement.className = obj.parentElement.className.replace(" over", "");
	}
	else if (obj.tagName == "TH")
	{
		obj.className = "";
	}
}

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 showHotAd(ID,Type)
{
	args = "top=0, left=0, height=675, width=700, status=no, toolbar=no, menubar=no, scrollbars=yes, location=no";
	window.open("showhotad.asp?AdvertiseID=" + ID + "&Type=" + Type, "Advertise"+ID, args);
}

function showAdPic(ID,Type)
{
	args = "top=0, left=0, height=675, width=700, status=no, toolbar=no, menubar=no, scrollbars=yes, location=no";
	window.open("showPhotos.asp?AdvertiseID=" + ID + "&Type=" + Type, "Advertise"+ID, args);
}

function showPage(ID)
{
	args = "top=0, left=0, height=675, width=700, status=no, toolbar=no, menubar=no, scrollbars=yes, location=no";
	window.open("showPage.asp?PageID=" + ID, "Page"+ID, args);
}

function showInfo(ID)
{
	args = "top=0, left=0, height=675, width=700, status=no, toolbar=no, menubar=no, scrollbars=yes, location=no";
	window.open("showInfo.asp?LinkID=" + ID, "Info"+ID, args);
}

function openPage(url)
{
	args = "top=0, left=0, height=500, width=700, status=no, toolbar=no, menubar=no, scrollbars=yes, location=no";
	window.open(url, "popupPage", args);
}

function showCoupon(id)
{
	args = "top=0, left=0, height=450, width=500, status=no, toolbar=no, menubar=no, scrollbars=yes, location=no";
	window.open("showcoupon.asp?AdvertiseID="+id, "popupCoupone"+id, args);
}

function img_onmouseover(source_pic){
	var imgSrc = new Image();
	imgSrc.src=source_pic;
	img_0.src=imgSrc.src;
}

function mov_onmouseover(source_mov){
	obj = document.getElementById("mov_0");
	obj.fileName = source_mov;
}

function showHide(id)
{
	var obj = window.event.srcElement;
	oDiv = document.getElementById(id);
	if (oDiv)
	{
		if (oDiv.style.display == "none")
		{
			oDiv.style.display = "";
		}
		else
		{
			oDiv.style.display = "none";
		}
	}
}

function showAd(url,id)
{			
	var obj = window.event.srcElement;
	URL = url + "_result_box.asp?AdvertiseID="+id;
	if(document.getElementById("AdDetails_" + id).innerHTML=="")
	{
  		document.getElementById("AdDetails_" + id).innerHTML="<TABLE WIDTH='100%' height='400' BORDER=0 CELLPADDING=0 CELLSPACING=0 dir=rtl><TR><TD><iframe  src='" + URL + "' width='100%' height='400' frameborder='0' scrolling='auto'></iframe></TD></TR></TABLE>";
		obj.parentElement.className += " click";
	 }
	else
	 {
		document.getElementById("AdDetails_" + id).innerHTML="";
		obj.parentElement.className = obj.parentElement.className.replace(" click", "");
	 }	
}

function showMail(url,id)
{			
	var obj = window.event.srcElement;
	URL = url + ".asp?MessageID="+id;
	if(document.all("MailDetails_" + id).innerHTML=="")
	{
  		document.all("MailDetails_" + id).innerHTML="<iframe  src='" + URL + "' width='100%' height='220' frameborder='0' scrolling='auto'></iframe>";
	 }
	else
	 {
		document.all("MailDetails_" + id).innerHTML="";
	 }	
}

function loadPage(url)
{
	var obj = window.event.srcElement;
	window.location.replace(url + obj.value);
}

function popUpWindow(URLStr)
{
  //popUpWin = window.open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menub ar=no,scrollbar=yes,scroll=yes,resizable=no,copyhistory=yes,width='+width+',height='+height+',left='+left+', top='+top+',screenX='+left+',screenY='+top+'');
  var w = 700;
  var h = 600;
  var winl = (screen.width - w) / 2;
  var wint = (screen.height - h) / 2;
  winprops = "top=" + wint + ",left=" + winl + ",status=no, toolbar=no, menubar=no, scrollbars=yes, location=no" + ",width="+ w + ",height="+ h;
  popUpWin = window.open(URLStr, "popUpWin", winprops)
  if (parseInt(navigator.appVersion) >= 4) { popUpWin.window.focus(); }  
}
