function checkNewForm( form )
{

form.query.value = form.query_holder.value;

// alert( form.query_holder.value );
// alert( form.query.value );

	form.db0.value = "INTRANET";
	form.db1.value = "ISS";
	form.db2.value = "TRUCKTOWN";
	form.db3.value = "DPG";
	form.db4.value = "IVED";
	form.db5.value = "POWERTRAIN";
	form.db6.value = "INTERNET";
	form.db7.value = "OSHAWA";
	form.db8.value = "CAR_TRUCK";
	form.db9.value = "MANUFACTURING";

x = countWords( form );
y = countLetters( form );

if( y == true )
	{
        if( x == true )
        	{
            	return true ;
         	}
         else if( x == false )
         	{
	        msg = "Form better results with this agent it is recommended that\n"+    
                	"you describe your interest using a sentence.\n"+
                  	"Click on OK to continue,\nor click on cancel to enter more text.\n"; 

                z = confirm( msg );
	        return z;
         	}
      	}
else
      {
      msg = "You must enter some query text!\n";
      alert( msg );
      return false; 
      }
}   




function countWords( form )
{
var query = form.query.value;
var found=0;
var i;

for( i = 0; i < query.length; i++ )
	{
        x = query.charAt( i );
        if( x == " " )
                {
                found++; 
                }
        }

if( found < 1 )
        {
        return false;
        }
else
        {
        return true;
        }
}


function countLetters( form )
{
var query = form.query.value;
if( query.length < 2 )
	{
        	// Likely to be no words at all
        return  false ;
        }
else
        {
        return  true ;
        }
}






function clearQuotes( form )
{
var query_string = form.query_holder.value;
var query_length = query_string.length;
var mod_query_string = "";

if( query_length == 1 )	
	{
	if( query_string.charAt( 0 ) == '\"' )		mod_query_string = "";
	}
else if( query_length > 1 )
	{
	if( query_string.charAt( 0 ) == '\"' )
		{
		for( i = 1; i < ( query_length - 1 ); i += 1 )	mod_query_string += query_string.charAt( i ) ;
		}
	else 	{
		for( i = 0; i < ( query_length - 1); i += 1 )	mod_query_string += query_string.charAt( i ) ;
		}
	if( query_string.charAt( query_length )  == '\"' ) 	mod_query_string += "" ;
	else	mod_query_string += query_string.charAt( query_length ) ;
	}
else mod_query_string = "";

return mod_query_string ;
}  


