<!--



re = /\w{1,}/;       //for test function


/***********************
this function trimming strings
***********************/
function rtrim(str)
	{
	return str.replace( /\s*$/, "" );
	}
function trim(str)
	{
	return( (""+str).replace(/^\s*([\s\S]*\S+)\s*$|^\s*$/,'$1') );
	}

//------------------------
// validates search string
//------------------------
function validateSearchForm(search_string, search_category)
	{
	errmsg=""
	errno=0

	search_string.value=trim(search_string.value)


	if( search_string.value =="" )
		{
		errno++
		errmsg=errmsg+errno+" - كلمات البحث<br>"
		if (errno==1)
			search_string.focus()
		}
	if( search_category.value =="" )
		{
		errno++
		errmsg=errmsg+errno+" - الخانة<br><br>"
		if (errno==1)
			search_category.focus()
		}

	if (errno!=0)
		{
		popupError(errmsg,300,150)
		return false
		}
	
	return true;

	}



//-->
