<!--

var count;
var QuoteCount; 
var QuoteError;

var index;
var remainder;

QuoteError = "false";

function validateSearch()
{
  with (document.searchform)
  { 
	count = 0;
	index = 0;
	
	QuoteCount = 0;
	
   	var quoteindex;
	var tempchar;

	quoteindex = Search.value.indexOf('"'); 

        if (quoteindex > -1) 
	    {
		  while (count < Search.value.length)
		  {			
		     tempchar = Search.value.substr(index, 1);

			 if (tempchar == '"')
			 {
				 QuoteCount = QuoteCount + 1;
		 
			 }
			
			 count = count + 1;
			 index = index + 1;
		  }

		   remainder = QuoteCount % 2;
		   
		   if (remainder > 0)		   
			  QuoteError = "true";		   
		   else			 
              QuoteError = "false";
		   
	    }

   
	if (Search.value.length == 0)
	 {
         alert("Please enter search word.");
		 Search.focus();
		 return false;
	 }

	if (Search.value.indexOf("'") > -1)
    {
	    alert("Please do not include an apostraphe in search.");
	    Search.focus();
		return false;	     
    } 


    if (QuoteError == "true")
    {
	    alert("Each beginning quote must have an ending quote.  Total quotes: " + QuoteCount);
	    Search.focus();
		return false;	     
    } 

    
    
  }

} 
 //-->
 