	// Building Ajax Object
	function GetXmlHttpObject()
	{
		var xmlHttp=null;
		try
		{
			// Firefox, Opera 8.0+, Safari
			xmlHttp=new XMLHttpRequest();
		}
		catch (e)
		{
			// Internet Explorer
			try
			{
				xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
			catch (e)
			{
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		return xmlHttp;
	}
	
	// Selected Country - Bring Cities
	function selectCountries()
	{	
		//alert('SLC');
		var cont=document.getElementById('selContinent');
		var selectedIndex = cont.selectedIndex;
		
		contSelectedValue = cont.options[selectedIndex].value;
		if (contSelectedValue==0) 
		{
			document.getElementById('countryHolder').innerHTML='<select style="width:120px; font:normal 9pt Arial" disabled><option>כל המדינות<\/option><\/select>';
		}
		else
		if (contSelectedValue==3) 
		{
			document.getElementById('countryHolder').innerHTML='<select id="selCountry" style="width:120px; font:normal 9pt Arial" disabled><option value="145">קנדה<\/option><\/select>';
			selectCities();
		}
		else	
			if (document.getElementById)
			{				
				xmlHttp=GetXmlHttpObject()
				if (xmlHttp==null)
				{
					alert ("הדפדפן בו אתה משתמש אינו תומך בטכנולוגייה הקיימת")
					return;
				}			
				
				var url="../Ajx/selectCountries.php"
				url=url+"?id="+contSelectedValue						
				url=url+"&uid="+Math.random();
				xmlHttp.onreadystatechange=selCountry; 
				xmlHttp.open("GET",url,true)
				xmlHttp.send(null)				
			}
	}
	
	function selCountry() 
	{ 	 
		if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
			//alert('HERE!');
			var response = xmlHttp.responseText;								
			document.getElementById('countryHolder').innerHTML=response;
			document.getElementById('selCountry').style.width='120px';
			document.getElementById('selCountry').disabled='';
		}
	}
	
	function selectCities()
	{	
		var city=document.getElementById('selCountry').value;
		if (city==0) 
		{
			document.getElementById('cityHolder').innerHTML='<select style="width:120px; font:normal 9pt Arial" disabled><option>כל הערים<\/option><\/select>';
		}		
		else	
			if (document.getElementById)
			{				
				xmlHttp=GetXmlHttpObject()
				if (xmlHttp==null)
				{
					alert ("הדפדפן בו אתה משתמש אינו תומך בטכנולוגייה הקיימת")
					return;
				}			
				
				var url="../Ajx/selectCities.php"
				url=url+"?id="+city						
				url=url+"&uid="+Math.random();
				xmlHttp.onreadystatechange=selCity; 
				xmlHttp.open("GET",url,true)
				xmlHttp.send(null)				
			}
	}
	
	function selCity() 
	{ 	 
		if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
			var response = xmlHttp.responseText;								
			document.getElementById('cityHolder').innerHTML=response;
			document.getElementById('selectCity').style.width='120px';			
		}
	}
	
	function selectSubSections()
	{	
		var sections=document.getElementById('mainSection').value;
		if (sections==0) 
		{
				document.getElementById('subSectionsHolder').innerHTML='<select style="width:120px; font:normal 9pt Arial" disabled><option>כל התחומים<\/option><\/select>';
		}
		else	
			if (document.getElementById)
			{				
				xmlHttp=GetXmlHttpObject()
				if (xmlHttp==null)
				{
					alert ("הדפדפן בו אתה משתמש אינו תומך בטכנולוגייה הקיימת")
					return
				}			
				
				var url="../Ajx/selectSubSections.php"
				url=url+"?id="+sections
				url=url+"&uid="+Math.random();
				xmlHttp.onreadystatechange=selSubSection; 
				xmlHttp.open("GET",url,true)
				xmlHttp.send(null)				
			}
	}
	
	function selSubSection() 
	{ 	 
		if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
		{
			var response= xmlHttp.responseText;														
			document.getElementById('subSectionsHolder').innerHTML=response;
			document.getElementById('subSection').style.width='120px';
		}
	}	

function showHideAdvSearch()
{
	var adv=document.getElementById('advSearch');
	if (adv.style.display!='') adv.style.display='';
	else adv.style.display='none';
}