﻿// This file includes all client side scripts of the site www.pashutmag.net
// Unauthorized use of the scripts inside is illegal and will be treated


// Variables
var xmlhttp;
var errMsg;


// Functions

function ifempt(theForm)
{
 if (searchform.search.value == "")
  {
    alert("לא ניתן לחפש ללא ערך חיפוש");
    searchform.search.focus();
    return (false);
  }
 if (searchform.search.value == "חיפוש")
  {
    alert("לא ניתן לחפש ללא ערך חיפוש");
    searchform.search.focus();
    return (false);
  }
    return (true);

}

function showBottomPanel(strPanel)
{
	document.getElementById('bp1').style.display='none';
	document.getElementById('bp2').style.display='none';
	document.getElementById('bp3').style.display='none';
	document.getElementById('bp4').style.display='none';
	document.getElementById(strPanel).style.display='block';
	if (document.getElementById('rt1'))
	{
		document.getElementById('rt1').style.borderBottomWidth = "1px";
		document.getElementById('rt2').style.borderBottomWidth = "1px";
		document.getElementById('rt3').style.borderBottomWidth = "1px";
		document.getElementById('rt4').style.borderBottomWidth = "1px";
		document.getElementById("rt" + strPanel.charAt(2)).style.borderBottomWidth = "0";
	}
}


function loadXMLDoc(url)
{
	// code for Mozilla, etc.
	if (window.XMLHttpRequest)
	{
		xmlhttp=new XMLHttpRequest()
		xmlhttp.onreadystatechange=xmlhttpChange
		xmlhttp.open("GET",url,true)
		xmlhttp.send(null)
	}
	// code for IE
	else if (window.ActiveXObject)
	{
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
		if (xmlhttp)
		{
			xmlhttp.onreadystatechange=xmlhttpChange
			xmlhttp.open("GET",url,true)
			xmlhttp.send()
		}
	}
}

function xmlhttpChange()
{
	// if xmlhttp shows "loaded"
	if (xmlhttp.readyState==4)
	{
		// if "OK"

		if (xmlhttp.status==200 && xmlhttp.responseText != "")
		{
			var listUsers = document.getElementById("listUsers");

			if (listUsers != null)
			{
				listUsers.options.length = 0;
				var arrUsers = xmlhttp.responseText.split(",");
				for (var i = 0, len = (arrUsers.length)-1; i < len; i+=2)
				{
					var oOption = document.createElement("OPTION");
					oOption.text = arrUsers[i+1];
					oOption.value = arrUsers[i];
					listUsers.options.add(oOption);
				}
			}
		}
		else
		{
			errMsg = xmlhttp.status;
		}
	}
}



function makevisible(cur,which)
{
  if (which==0)
    cur.filters.alpha.opacity=100
  else
    cur.filters.alpha.opacity=60
}


function openWindow(url)
{
	param = "left=450,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=350,height=320";
	name = ""
	window.open (url,name,param)
}

