 function isValidEmail(email, required) 
    {
        if (required==undefined) {   // if not specified, assume it's required
            required=true;
        }
        if (email==null) {
            if (required) {
                return false;
            }
            return true;
        }
        if (email.length==0) {  
            if (required) {
                return false;
            }
            return true;
        }
        if (! allValidChars(email)) {  // check to make sure all characters are valid
            return false;
        }
        if (email.indexOf("@") < 1) { //  must contain @, and it must not be the first character
            return false;
        } else if (email.lastIndexOf(".") <= email.indexOf("@")) {  // last dot must be after the @
            return false;
        } else if (email.indexOf("@") == email.length) {  // @ must not be the last character
            return false;
        } else if (email.indexOf("..") >=0) { // two periods in a row is not valid
	    return false;
        } else if (email.indexOf(".") == email.length) {  // . must not be the last character
	    return false;
        }
        return true;
    }

    function allValidChars(email) 
    {
      var parsed = true;
      var validchars = "abcdefghijklmnopqrstuvwxyz0123456789@.-_";
      for (var i=0; i < email.length; i++) {
        var letter = email.charAt(i).toLowerCase();
        if (validchars.indexOf(letter) != -1)
          continue;
        parsed = false;
        break;
      }
      return parsed;
    }
   
   
    function valid()
        {
            if(document.getElementById("txtName").value=="" || document.getElementById("txtName").value=="Name")
                {
                    document.getElementById("Message").innerHTML = "&middot; Enter First Name";
                }
            else if(document.getElementById("txtEmail").value=="" || document.getElementById("txtEmail").value=="E-mail")
                {
                    document.getElementById("Message").innerHTML = "&middot; Enter Email Address";
                }
            else if(isValidEmail(document.getElementById("txtEmail").value,'')==false)
                {
                    document.getElementById("Message").innerHTML = "&middot; Enter Email Not Address";
                }                
            else if(document.getElementById("txtLocation").value=="" || document.getElementById("txtLocation").value=="Location")    
                {
                    document.getElementById("Message").innerHTML = "&middot; Enter Location";
                }
            else if(document.getElementById("txtQuery").value=="" || document.getElementById("txtQuery").value=="Your Query")    
                {
                    document.getElementById("Message").innerHTML = "&middot; Enter Your Query";
                }
            else
                {
                    document.form1.submit();
                }    
        }
        
        function fname(obj)
        {
          if(obj.value=='')
            {
           obj.value="Name";
           return false;
            }
          if(obj.value=='Name')
            {
            obj.value = '';  
            }  
        }
        function email(obj)
        {
          if(obj.value=='')
            {
           obj.value="E-mail";
           return false;
            }
          if(obj.value=='E-mail')
            {
            obj.value = '';  
            }  
        }
        function chat(obj)
        {
          if(obj.value=='')
            {
           obj.value="Chat ID";
           return false;
            }
          if(obj.value=='Chat ID')
            {
            obj.value = '';  
            }  
        }
        
        function Location(obj)
        {
          if(obj.value=='')
            {
           obj.value="Location";
           return false;
            }
          if(obj.value=='Location')
            {
            obj.value = '';  
            }  
        }
        
        function Query(obj)
        {
          if(obj.value=='')
            {
           obj.value="Your Query";
           return false;
            }
          if(obj.value=='Your Query')
            {
            obj.value = '';  
            }  
        }
        
           
        
        function quote()
            {
            var str='';
            str += "<div class='quickquote'>";
            str += "<div class='quoteheading'>quick quote:</div>";
            str += "<div Id='Message' class='message'></div>";
            str += "<div class='quoteform'>";
            str += "<form id='form1' name='form1' method='post' action='sendmail.html'>";
            str += "    <p>";
            str += "      <input id='txtName' class='quoteformbox' name='txtName' value='Name' onfocus='fname(this);' onblur='fname(this);' maxlength='100' />";
            str += "    </p>";
            str += "    <p>";
            str += "      <input id='txtEmail' name='txtEmail' type='text' class='quoteformbox' value='E-mail' onfocus='email(this);' onblur='email(this);' style='width:180px' maxlength='255'/>";
            str += "    </p>";
            str += "    <p>";
            str += "      <select id='ChatServices' name='ChatServices' class='quoteformbox'  id='ChatServices' style='width:95px'>";
            str += "        <option>Chat Services</option>";
            str += "        <option value='Yahoo'>Yahoo</option>";
            str += "        <option value='GTalk'>GTalk</option>";
            str += "        <option value='Skype'>Skype</option>";
            str += "        <option value='Live / MSN'>Live / MSN</option>";
            str += "      </select>";
            str += "      <input id='ChatId' name='ChatId'  type='text' class='quoteformbox' value='Chat ID' onfocus='chat(this);' onblur='chat(this);' style='width:80px' maxlength='255'/>";
            str += "    </p>";
            str += "    <p>";
            str += "      <input id='txtLocation' name='txtLocation' type='text' class='quoteformbox' onfocus='Location(this);' onblur='Location(this);' value='Location' style='width:180px' maxlength='255' />";
            str += "    </p>";
            str += "    <p>";
            str += "      <textarea name='txtQuery' rows='4' class='quoteformbox' id='txtQuery' onfocus='Query(this);' onblur='Query(this);' style='width:180px'>Your Query</textarea>";
            str += "    </p>";
            str += "    <p>";
            str += "      <input name='button' type='button' class='submitbut' id='button' value='Submit' onclick=valid(); />";
            str += "    </p>";
            str += "  </form>";
			str += "</div>";
            str += "<img src='images/quote-b.png' alt='web design and development free quick quote' title='web design and development free quick quote' width='225' height='8' />";
            document.getElementById('divRequestQuote').innerHTML = str;
         }
        

        function innerquote()
            {
            var str='';
            str += "<div class='quicknaviquote'>";
            str += "<div class='quotenaviheading'>quick quote:</div>";
            str += "<div Id='Message' class='message'></div>";
            str += "<div class='quotenaviform'>";
            str += "<form id='form1' name='form1' method='post' action='sendmail.html'>";
            str += "    <p>";
            str += "      <input id='txtName' class='quotenaviformbox' name='txtName' value='Name' onfocus='fname(this);' onblur='fname(this);' maxlength='100' />";
            str += "    </p>";
            str += "    <p>";
            str += "      <input id='txtEmail' name='txtEmail' type='text' class='quotenaviformbox' value='E-mail' onfocus='email(this);' onblur='email(this);' style='width:180px' maxlength='255'/>";
            str += "    </p>";
            str += "    <p>";
            str += "      <select id='ChatServices' name='ChatServices' class='quotenaviformbox'  id='ChatServices' style='width:95px'>";
            str += "        <option>Chat Services</option>";
            str += "        <option value='Yahoo'>Yahoo</option>";
            str += "        <option value='GTalk'>GTalk</option>";
            str += "        <option value='Skype'>Skype</option>";
            str += "        <option value='Live / MSN'>Live / MSN</option>";
            str += "      </select>";
            str += "      <input id='ChatId' name='ChatId'  type='text' class='quotenaviformbox' value='Chat ID' onfocus='chat(this);' onblur='chat(this);' style='width:80px' maxlength='255'/>";
            str += "    </p>";
            str += "    <p>";
            str += "      <input id='txtLocation' name='txtLocation' type='text' class='quotenaviformbox' onfocus='Location(this);' onblur='Location(this);' value='Location' style='width:180px' maxlength='255' />";
            str += "    </p>";
            str += "    <p>";
            str += "      <textarea name='txtQuery' rows='4' class='quotenaviformbox' id='txtQuery' onfocus='Query(this);' onblur='Query(this);' style='width:180px'>Your Query</textarea>";
            str += "    </p>";
            str += "    <p>";
            str += "      <input name='button' type='button' class='submitbut' id='button' value='Submit' onclick=valid(); />";
            str += "    </p>";
            str += "  </form>";
            str += "</div>";
			str += "<img src='images/quotenavi-b.jpg' alt='web design and development free quick quote' title='web design and development free quick quote' width='210' height='4' />";
			str += "</div>";
            document.getElementById('divRequestQuote').innerHTML = str;
         }
   <!-- 
