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 GetComboData( ComboID, Name, Table, Src, SrcValue ){ 
 var combo = document.getElementById(ComboID);
 var retArr = new Array();
 var myAjax = new Ajax.Request(
   'getdata.asp?Name='+Name+'&Table='+Table+'&Src='+Src+'&SrcValue='+SrcValue,
   {
    method: 'get', 
    onComplete: function(response) { 
     retArr=response.responseText.split(';');
     combo.options.length=1;
     for(i=0; i< (retArr.length/2)-1; i++){
      combo.options[i+1] = new Option(retArr[2*i], retArr[2*i+1]);
     }
     combo.selectedIndex=0;
     
    }
    
   }
 );
}

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)
			{
				if (strSort.indexOf("DESC") != -1)
				{
				strURL = strURL.substring(0,strURL.length - 4)
				}
				else
				{
				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 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,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 showPhoto(src,name)
{
	NewWindow("showpic.asp?Pic="+src+"&PicText=" + name,"Photo","500","500","no","center");
}

function showSale(id) {
var w = 750;
var h = 500;
mypage = 'showSale.asp?SaleID=' + id;
NewWindow(mypage,'sale'+id,w,h,'yes','center');

}

function showBabysiter(id) {
var w = 750;
var h = 500;
mypage = 'showBabysiter.asp?BabySiterID=' + id
NewWindow(mypage,'babysiter'+id,w,h,'yes','center');
}

function showJob(id) {
var w = 750;
var h = 500;
mypage = 'showjob.asp?JobID=' + id
NewWindow(mypage,'job'+id,w,h,'yes','center');

}

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 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)
{
	oDiv = document.getElementById(id);
	if (oDiv)
	{
		if (oDiv.style.display == "none")
		{
			oDiv.style.display = "inline";
		}
		else
		{
			oDiv.style.display = "none";
		}
	}
}
function showAd(url,id, h)
{		
	var obj = document.getElementById('AdTitle_'+id);
	URL = url + "_result_box.asp?AdvertiseID="+id;
	if(!insideHTML('AdDetails_' + id))
	{
		makeRemark('AdDetails_' + id,'<iframe src="' + URL + '" style="width:100%; height:' + h + 'px;" frameborder="0" scrolling="no"></iframe>');
		obj.className += " click";
	 }
	else
	 {
		makeRemark('AdDetails_' + id,'');
		obj.className = obj.className.replace(" click", "");
	 }
}

function showMail(url,id)
{		
	var obj = document.getElementById('MailTitle_'+id);
	URL = url + ".asp?MessageID="+id;
	if(!insideHTML('MailDetails_' + id))
	{
  		makeRemark('MailDetails_' + id,'<iframe src="' + URL + '" style="width:100%; height:220px;" frameborder="0" scrolling="auto"></iframe>');
	 }
	else
	 {
		makeRemark('MailDetails_' + id,'');
	 }	
}

function loadPage(url,val)
{
	//var obj = window.event.srcElement;
	window.location.replace(url + val);
}

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(); }  
}

//Miscellaneous JavaScript Functions Written by Shawn Olson
//Copyright 2005 by Shawn Olson
//Permission to use these scripts provided credit is provided to Shawn Olson
//Find more JavaScript resources at http://www.shawnolson.net/topics/JavaScript/ 


function insideHTML(cell){
eval('theCell = document.getElementById("'+cell+'").innerHTML');
return theCell;
}


function checkValueAgainst(objId,val1){
if(insideHTML(objId)==val1){verify=true;} else {verify=false;}
return verify;
}

function makeRemark(target,statement){
string = 'theTarget = document.getElementById("'+target+'");';
eval(string);
if(theTarget != null){
 theTarget.innerHTML = statement;
}

}

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);}

//----------------------------- NO RIGHT CLICK -------------------------------
// (C) 2003 CodeLifter.com
// Source: CodeLifter.com
// Do not remove this header

// Set the message for the alert box
/*am = "! GAN4U כל הזכויות שמורות לאתר";

// 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;*/