function checkText(that,errorPlace,errorMessage)
{
	if (/^[a-zA-Z,.א-ת\- ]+$/m.test(that.value))
		return true;
	else
	{
		if (errorPlace)
		{
			errorPlace.innerHTML=errorMessage;
			that.value='';
		}
		return false;
	}
}
function checkPhoneNumber(that,errorPlace,errorMessage)
{
	if (/^(?:^(04|03|02|08|050|052|054|057|077|072|073|074|076|079)(-)?[0-9]{7}$)$/m.test(that.value))
		return true;
	else
	{
		if (errorPlace)
		{
			errorPlace.innerHTML=errorMessage;
			that.value='';
		}
		return false;
	}
}
function checkSelection(that,errorPlace,errorMessage)
{
	if(that.selectedIndex==0)
	{
		if (errorPlace)
		{
			errorPlace.innerHTML=errorMessage;
			that.value='';
		}
		return false;
	}
	else
		return true;
}
function checkHTTPAddress(that,errorPlace)
{
	if (/^(?:^[a-z][a-z0-9+\-.]*:\/\/([a-z0-9\-._~%!$&'()*+,;=]+@)?([a-z0-9\-._~%]+|\[[a-f0-9:.]+\]|\[v[a-f0-9][a-z0-9\-._~%!$&'()*+,;=:]+\])(:[0-9]+)?(\/[a-z0-9\-._~%!$&'()*+,;=:@]+)*\/?(\?[a-z0-9\-._~%!$&'()*+,;=:@\/?]*)?(#[a-z0-9\-._~%!$&'()*+,;=:@\/?]*)?$)$/.test(that.value))
		return true;
	else
	{
		if (errorPlace)
		{
			errorPlace.innerHTML='Invalid URL address';
			that.value='';
		}
		return false;
	}
}

function checkEmail(that,errorPlace)
{
	if (that.value.match(/^(?:(?:[a-z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+\/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\]))$/))
		return true;
	else
	{
		if (errorPlace)
		{
			errorPlace.innerHTML='Invalid email address';
			that.value='';
		}
		return false;
	}
}
function isnumric(that)
{
	subject=that.value;
	if (subject)
	{
		if (subject.match(/^[0-9.]+$/))
			return true;
		else
		{
			that.value='';
			alert('This field requierd numeric data.');
			that.focus();
			return false;
		}
		return false;
	}
}
function selectSelectedByValue(SelectObject,selectValue)
{
	var i=0;
	while(i<SelectObject.options.length)
	{
		if (SelectObject.options[i].value==selectValue)
		{
			SelectObject.options[i].selected=true;
			return;
		}
		i++;
	}
}
