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 + "\n" + xmlhttp.responseText);
				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 fill2(combo, name, src)
{
	var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4)
		{
			if (xmlhttp.status != 200)
			{
				alert("שגיאה! - " + xmlhttp.status + "\n" + xmlhttp.responseText);
				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", "getxml2.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=500, 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 showHotAd(ID,Type)
{
	args = "top=0, left=0, height=675, width=785, status=no, toolbar=no, menubar=no, scrollbars=yes, location=no";
	window.open("showhotad.asp?AdvertiseID=" + ID + "&Type=" + Type, "Advertise"+ID, args);
}

function showCoupon(CouponID)
{
	var w = 510;
	var h = 560;
	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 showAdPic(ID)
{
	args = "top=0, left=0, height=675, width=785, status=no, toolbar=no, menubar=no, scrollbars=yes, location=no";
	window.open("showPhotos.asp?AdvertiseID=" + ID, "Advertise"+ID, args);
}

function showItem(GalleryID,PhotoID)
{
	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("showItem.asp?GalleryID=" + GalleryID + "&PhotoID=" + PhotoID, "Item"+PhotoID, args);
}

function newsItem(id)
{
	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("newsItem.asp?NewsID=" + id, "News_"+id, args);
}

function showPhoto(Photo,Details,Phone)
{
	args = "top=0, left=0, height=675, width=785, status=no, toolbar=no, menubar=no, scrollbars=yes, location=no";
	window.open("showPhoto.asp?Photo=" + Photo + "&Details=" + Details + '&Phone=' + Phone, "Photo", args);
}

function rankSite(ID)
{
	args = "top=0, left=0, height=675, width=785, status=no, toolbar=no, menubar=no, scrollbars=yes, location=no";
	window.open("Site.asp?SiteID=" + ID, "Site"+ID, args);
}

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);
}

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.all("AdDetails_" + id).innerHTML=="")
	{
  		document.all("AdDetails_" + id).innerHTML="<iframe  src='" + URL + "' width='100%' height='410' frameborder='0' scrolling='auto'></iframe>";
		obj.parentElement.className += " click";
	 }
	else
	 {
		document.all("AdDetails_" + id).innerHTML="";
		obj.parentElement.className = obj.parentElement.className.replace(" click", "");
	 }	
}

function loadPage(url)
{
	var obj = window.event.srcElement;
	window.location.replace(url + obj.value);
}

function showBan(divName,width,height,wmode,src,bgcolor) {
	var d=document.getElementById(divName);
	d.innerHTML='<OBJECT classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0  WIDTH='+width+' HEIGHT='+height+'>'+wmode+'<PARAM NAME=movie VALUE="'+src+'"><PARAM NAME=quality VALUE=high><param name=bgcolor value="'+bgcolor+'"><EMBED src="'+src+'" quality=high WIDTH='+width+' HEIGHT='+height+' bgcolor="'+bgcolor+'" TYPE=application/x-shockwave-flash PLUGINSPAGE=http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash></EMBED></OBJECT>';
}

function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}