 function Trim(str) 
{ 
 
  return LTrim(RTrim(str)); 
 
} 
 
 
function LTrim(str) 
{ 
 
  for (var i=0; str.charAt(i)==" "; i++) 
  { 
    str =  str.substring(i,str.length-1); 
  } 
  return str; 
} 
 
 
function RTrim(str) 
{ 
 
  for (var i=str.length-1; str.charAt(i)==" "; i--) 
  {   
    str = str.substring(0,i); 
  } 
  return str; 
} 
 
function enterRTrim(str) 
{ 
var whitespace = new String(" \t\n\r"); 
 
   var s = new String(str); 
 
   if (whitespace.indexOf(s.charAt(s.length-1)) != -1) { 
      // We have a string with trailing blank(s)... 
 
      var i = s.length - 1;       // Get length of string 
 
      // Iterate from the far right of string until we 
      // don't have any more whitespace... 
      while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1) 
         i--; 
 
 
      // Get the substring from the front of the string to 
      // where the last non-whitespace character is... 
      s = s.substring(0, i+1); 
   } 
 
   return s; 
 
} 
function enterLTrim(str) 
{ 
 var whitespace = new String(" \t\n\r"); 
 
   var s = new String(str); 
 
   if (whitespace.indexOf(s.charAt(0)) != -1) { 
      // We have a string with leading blank(s)... 
 
      var j=0, i = s.length; 
 
      // Iterate from the far left of string until we 
      // don't have any more whitespace... 
      while (j < i && whitespace.indexOf(s.charAt(j)) != -1) 
         j++; 
 
      // Get the substring from the first non-whitespace 
      // character to the end of the string... 
      s = s.substring(j, i); 
   } 
   return s; 
 
} 
function enterTrim(str) 
{ 
return enterRTrim(enterLTrim(str)); 
} 

 	var firstarg = Math.ceil(Math.random() * 10);
    var secontarg = Math.ceil(Math.random() * 10);       
    var finalarg = firstarg + secontarg
    function DrawBotBoot123()
    {
        document.write(""+ firstarg + " + " + secontarg +" =");
        //document.write("<input id='BotBootInput' name='BotBootInput' class='form-input' type='text' maxlength='2' />");
    }

function quote_validate()
{
var textvaluearg = document.getElementById('security').value;

    if(RTrim(document.quote.name.value)=="") 
        { 
            alert("Please enter name"); 
            document.quote.name.focus(); 
            document.quote.name.value=""; 
            return false; 
        } 
		   if(RTrim(document.quote.email_add.value)=="") 
        { 
            alert("Please enter E-mail address"); 
            document.quote.email_add.focus(); 
            document.quote.email_add.value=""; 
           return false; 
        } 
		 
		if (document.quote.email_add.value != "") 
		{ 
		        re=/\w{1,}/; 
		        emailExp= /^\w+(\-\w+)*(\.\w+(\-\w+)*)*@\w+(\-\w+)*(\.\w+(\-\w+)*)+$/ ;  
		        if(!(emailExp.test(document.quote.email_add.value))) 
		        { 
		        alert("Please Enter Correct E-mail address"); 
		        document.quote.email_add.focus(); 
		        return false; 
		        } 
		} 
		 if(enterTrim(document.quote.message.value)=="") 
        { 
            alert("Please enter message"); 
            document.quote.message.focus(); 
            document.quote.message.value=""; 
            return false; 
        }  
		 if(RTrim(document.quote.security.value)=="") 
        { 
            alert("Please enter value"); 
            document.quote.security.focus(); 
            document.quote.security.value=""; 
            return false; 
        } 
       if (textvaluearg != finalarg)
		{ 
		alert("Please enter correct value");
		document.getElementById('security').focus();
		document.getElementById('security').value="";
		return false;
		} 
    
	return true; 
}
