function ahah(url, target) {
  document.getElementById(target).innerHTML = ' טוען מידע, אנא המתן...';
  if (window.XMLHttpRequest) {
    req = new XMLHttpRequest();
  } else if (window.ActiveXObject) {
    req = new ActiveXObject("Microsoft.XMLHTTP");
  }
  if (req != undefined) {
    req.onreadystatechange = function() {ahahDone(url, target);};
    req.open("GET", url, true);
    req.send("");
  }
}  

function ahahDone(url, target) {
  if (req.readyState == 4) { // only if req is "loaded"
    if (req.status == 200) { // only if "OK"
      document.getElementById(target).innerHTML = req.responseText;
    } else {
      document.getElementById(target).innerHTML=" שגיאה:\n"+ req.status + "\n" +req.statusText;
    }
  }
}



function hideDiv() { 
	if (document.getElementById) { // DOM3 = IE5, NS6 
		document.getElementById('hideshow').style.visibility = 'hidden'; 
	} 
	else { 
		if (document.layers) { // Netscape 4 
			document.hideshow.visibility = 'hidden'; 
		} 
		else { // IE 4 
			document.all.hideshow.style.visibility = 'hidden'; 
		} 
	} 
}
	
	function showDiv(popupTitle, popupContent) { 
		//before showing the popup we change the contents
		document.getElementById("popupTitle").innerHTML = popupTitle;
		//document.getElementById("popupContent").innerHTML = popupContent;
		ahah(popupContent,"popupContent");
	
		if (document.getElementById) { // DOM3 = IE5, NS6 
			document.getElementById('hideshow').style.visibility = 'visible'; 
		} 
		else { 
			if (document.layers) { // Netscape 4 
				document.hideshow.visibility = 'visible'; 
			} 
			else { // IE 4 
				document.all.hideshow.style.visibility = 'visible'; 
			} 
		} 
	}
	
	function toggleVis(target) {
		target = document.getElementById(target);
		if(target.style.display == "block")
			{
				target.style.display = "none";
			}
		else
		{
			target.style.display = "block";
		}
	}
