document.write("<style>");
//document.write(".queryfrm{border:#d7d138 solid 1px;}");
document.write(".graybgd1{border:#838380 solid 1px; background-color:#f4f2db;}");
document.write(".lefttbltxt{font-size:14px; font-weight:bold; font-family:Verdana, Arial, Helvetica, sans-serif;}");
document.write(".mumbaipd{padding-top:3px; padding-bottom:3px;}");
document.write(".mumbaipdleft{padding-left:12px;}");
document.write(".qfrm {color: #000000}");
document.write("<\/style>");
document.writeln("<table class=\"graybgd1\">");
document.writeln("				<tr><td colspan=\"2\" bgcolor=\"#f4f2db\" class=\"lefttbltxt mumbaipd mumbaipdleft qfrm\">Quick query</td>");
document.writeln("				</tr>");
document.writeln("");
document.writeln("                  <tr>");
document.writeln("                    <td width=\"34\"  class=\"frmtxt\">&nbsp;</td>");
document.writeln("                    <td width=\"200\" align=\"left\" ><input name=\"nametxt\" id=\"nametxt\" onblur=\"javascript:qfrm1();\"  onfocus=\"javascript:qfrm2();\"  value=\"Name\" /></td>");
document.writeln("                  </tr>");
document.writeln("                  <tr>");
document.writeln("                    <td class=\"frmtxt\">&nbsp;</td>");
document.writeln("                    <td align=\"left\"><input  name=\"emailtxt\" onblur=\"javascript:qfrm3();\"  onfocus=\"javascript:qfrm4();\"  id=\"emailtxt\"  value=\"Email\" /></td>");
document.writeln("                  </tr>");
document.writeln("");
document.writeln("                  <tr>");
document.writeln("                    <td class=\"frmtxt\">&nbsp;</td>");
document.writeln("                    <td align=\"left\" ><textarea  name=\"commentstxt\" onblur=\"javascript:qfrm5();\"  onfocus=\"javascript:qfrm6();\"  id=\"commentstxt\" >Comments</textarea></td>");
document.writeln("                  </tr>");
document.writeln("				  <tr>");
document.writeln("                    <td colspan=\"2\" align=\"center\"><input style=\"font-weight: bold; color: #ffffff; border-style: solid; border-width: 1; border-color:#FFFFFF; background-color: #98936a\" type=\"button\" onclick=\"querymail()\"  value=\"SEND\" /></td>");
document.writeln("                  </tr>");
document.writeln("				 </table>");

function querymail()
{	
var nametxt=document.getElementById("nametxt").value;
var emailtxt=document.getElementById("emailtxt").value;
var commentstxt=document.getElementById("commentstxt").value;

if((emailtxt !="") && (emailtxt.indexOf("@")== -1) || (emailtxt.indexOf(".")== -1))
{
alert("plz enter the valid email ");
//emailtxt.focus();
}
else
{
if(nametxt=="" || emailtxt=="")
{
alert("Please fill the required fields");
}
else
{
			var xmlhttp = false;
			//Check if we are using IE.
			try
			{
			//If the Javascript version is greater than 5.
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
			} 
			catch (e) 
			{
			//If not, then use the older active x object.
					try 
					{
					//If we are using Internet Explorer.
					xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			
			} catch (e) 
			{
			//Else we must be using a non-IE browser.
			xmlhttp = false;
			}
			}
			//If we are using a non-IE browser, create a javascript instance of the object.
			
			if (!xmlhttp && typeof XMLHttpRequest != 'undefined') 
				{
					xmlhttp = new XMLHttpRequest();
			
				}

					send_url='query_mail.php?nametxt='+nametxt+'&emailtxt='+emailtxt+'&commentstxt='+commentstxt;
				alert("Your query has been sent ");
					xmlhttp.open("GET",send_url,true);
					xmlhttp.onreadystatechange = function() 
					{
						if (xmlhttp.readyState == 4 ) 
					{	}
							}					
					xmlhttp.send(null);

}
document.getElementById("nametxt").value="";
document.getElementById("emailtxt").value="";
document.getElementById("commentstxt").value="";
}
}


function qfrm2()
{
if(document.getElementById('nametxt').value=="Name")
document.getElementById('nametxt').value="";
}
function qfrm1()
{
if(document.getElementById('nametxt').value=="")
document.getElementById('nametxt').value="Name";
}
function qfrm4()
{
if(document.getElementById('emailtxt').value=="Email")
document.getElementById('emailtxt').value="";
}
function qfrm3()
{
if(document.getElementById('emailtxt').value=="")
document.getElementById('emailtxt').value="Email";
}
function qfrm6()
{
if(document.getElementById('commentstxt').value=="Comments")
document.getElementById('commentstxt').value="";
}
function qfrm5()
{
if(document.getElementById('commentstxt').value=="")
document.getElementById('commentstxt').value="Comments";
}
