// JavaScript Document

    function postRequest(strURL){
                    var xmlHttp;
                    if(window.XMLHttpRequest){ // For Mozilla, Safari, ...
                         var xmlHttp = new XMLHttpRequest();
                    }
                    else if(window.ActiveXObject){ // For Internet Explorer
                         var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
                    }
                    xmlHttp.open('POST', strURL, true);
                    xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
                    xmlHttp.onreadystatechange = function(){
                         if (xmlHttp.readyState == 4){
                              updatepage(xmlHttp.responseText);
                         }
                    }
                    xmlHttp.send(strURL);
               }
               
               function updatepage(str){
                    //document.getElementById('result').value = str;
					alert(str);
               }
			   function t()
			    {
					 alert("hell");
				}
			    function callcart(u){
                    
                   //  var a = parseInt(document.f1.t1.value);
                   // var b = parseInt(document.f1.t3.value);
                   //var c = document.f1.t2.value;
                 //var url = "phparray.php?a=" + a + "&b=" + b + "&c="+ c + "";
				 x=document.getElementById('name').value;
				  y=document.getElementById('email').value;
				   z=document.getElementById('comment').value;
				
                 var str=u+"?a="+ x +"&b="+ y +"&c="+z+ "";
			
				  if(validname())
				  {
					    if(validemail())
						 {
							  if(validmessage())
							   {
		                         postRequest(str); 							  
								}
							   else
							   {
								    alert("Not a Valid Message")
							   }
						 }
						 else
						  {
							   alert("Not A valid Email");
						  }
					    
				  }
				  else
				   {
					    alert("Not A valid Name");
				   }
		
				}
				
				function validname()
{
	 a=document.getElementById('name').value;;
	 n="^[a-zA-Z]{1,16}$";
	 if(a.match(n))
			 {
			
			return true;
			 }
			 else
			  {
			
				return false;
				 } 
}
function validemail()

   {        var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
       em=document.getElementById('email').value;;
		if(em.match(emailfilter))
		  {		  			return true;

		  }
		  else
		    {
				return false;

			}

     }
	  function validmessage()

   {       
       m=document.getElementById('comment').value;
		if(m!="")
		  {		  			return true;

		  }
		  else
		    {
				return false;

			}

     }

