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 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 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>';
}

//----------------------------- NO RIGHT CLICK -------------------------------
// (C) 2003 CodeLifter.com
// Source: CodeLifter.com
// Do not remove this header

// Set the message for the alert box
am = "All Rights Resereved!";

// do not edit below this line
// ===========================
bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"

function nrc(e) {
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
}

document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;
//--------------------------------------------------------------------------------------
/***********************************************
* Disable select-text script- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
* Modified here to exclude form tags properly and cross browser by jscheuer1
***********************************************/

//form tags to omit:
var omitformtags=["input", "textarea", "select"]

function disableselect(e){
for (i = 0; i < omitformtags.length; i++)
if (omitformtags[i]==(e.target.tagName.toLowerCase()))
return;
return false
}

function reEnable(){
return true
}

function noSelect(){
	if (typeof document.onselectstart!="undefined"){
		document.onselectstart=new Function ("return false")
		if (document.getElementsByTagName){
		tags=document.getElementsByTagName('*')
		for (j = 0; j < tags.length; j++){
			for (i = 0; i < omitformtags.length; i++)
				if (tags[j].tagName.toLowerCase()==omitformtags[i]){
					tags[j].onselectstart=function(){
						document.onselectstart=new Function ('return true')
						}
						tags[j].onmouseup=function(){
						document.onselectstart=new Function ('return false')
					}
				}
			}
		}
	}
	else{
		document.onmousedown=disableselect
		document.onmouseup=reEnable
	}
}

window.onload=noSelect;
