<!-- Toll Free SMS Script - Static Widget-->

<!-- This goes into the HEAD of the html file -->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Contact Us</title>

<style>
.popup { float:left; width:275px; padding:5px;  border:3px solid #a6a6a6; z-index:100px; background:#FFFFFF;}
.zeroborder{	border:0px; text-decoration:none; cursor:pointer;}
</style>


<script>
	function GetXmlHttpObject()
	{
		if (window.XMLHttpRequest)
		{
			// code for IE7+, Firefox, Chrome, Opera, Safari
			return new XMLHttpRequest();
		}
		if (window.ActiveXObject)
		{
			// code for IE6, IE5
			return new ActiveXObject("Microsoft.XMLHTTP");
		}
		return null;
	}
	function checkValidation()
	{
		if(document.getElementById("UserName").value == "")
		{
			return false;
		}
		else if(checkMobileNo(document.getElementById("Mobile").value) == false)
		{
			alert("Please enter mobile no.");
			return false;
		}
		else if(document.getElementById("Message_temp").value == "")
		{
			alert("Please enter message");
			return false;
		}
		else
		{
			document.getElementById("Message").value = document.getElementById("Mobile").value+":"+document.getElementById("Message_temp").value;
			send_message();
		}
	}
	function checkMobileNo(mobile_no)
	{
		var y = mobile_no;	
		if(isNaN(y)||y.indexOf(" ")!=-1)
		{
			return false; 
		}
		if (y.length!=10)
		{
			return false;
		}
		return  true;
	}
	
	function send_message()
	{
		xmlhttp=GetXmlHttpObject();
		if (xmlhttp==null)
		{
			alert ("Your browser does not support XMLHTTP!");
			return;
		}
		xmlhttp.onreadystatechange=stateChangedsend_message; 
		xmlhttp.open("POST", "http://www.smsgatewaycenter.com/library/contact_us_send.php?UserName="+document.getElementById("UserName").value+"&Message="+document.getElementById("Message").value,true);
		xmlhttp.send(null);
	}
	function stateChangedsend_message()
	{
		if (xmlhttp.readyState==4)
		{
			document.getElementById("form").innerHTML = xmlhttp.responseText;
			//document.getElementById("form").innerHTML = "Your message send successfully.";
		}
		else if (xmlhttp.readyState == 1)
		{
			document.getElementById("form").innerHTML = "<img src=\"http://www.smsgatewaycenter.com/images/loader.gif\" />";
		}
	}
	function message_length()
	{
		var message_length = 0;
		var maxlimit = 148;
		var message = "";
		message_length = document.getElementById("Message_temp").value.length + 1;
		if(message_length >= maxlimit)
		{	
			document.getElementById("Message_temp").value = document.getElementById("Message_temp").value.substring(0, maxlimit-1);
			message_length = document.getElementById("Message_temp").value.length + 1;
		}
		if(message_length == 0)
		{
			document.getElementById("Message_note").innerHTML = "";
		}
		else
		{
			document.getElementById("Message_note").innerHTML = "Message Length:"+message_length+"/148";
		}
	}
</script>
</head>

<!-- End of the HEAD of the html file -->


<!-- This goes into the BODY of the html file -->


<body>

<!-- popup -->
<div class="popup fixme"  style="z-index:100; visibility:visible;" id="chat_popup"  >
<table>
    <tr>
        <td>
            <div class="zeroborder" onclick="contact_up_popup();"   style=" font-size:20px; color:#0000FF; border:1; width:15px; "  >
                S<br />
                e<br />
                n<br />
                d<br />
                <br />
                T<br />
                o<br />
                l<br />
                l<br />
                F<br />
                r<br />
                e<br />
                e<br />
                <br />
                S<br />
                M<br />S
            </div>
        </td>
        <td valign="middle" ><div align="center"><img src="images/sgc_small_logo.gif" border="0" width="100" height="100" alt="Sms Gateway"></div><br /><br />
        	<div id="form">

                <font color="#FF0000"><b>Your Mobile No.</b><br />
                <input type="hidden" name="UserName" id="UserName"  size="200px" value="TollFreeSms" />
                <input type="text" name="Mobile" id="Mobile"  />
                <br /><br />
                <font color="#FF0000"><b>Send us your Message, we will call you.</b></font>
                <br /> <input type="hidden" name="Message" id="Message"  />
                <textarea name="Message_temp" id="Message_temp"  cols="28" rows="6"  onkeypress="message_length()" onchange="message_length()" /></textarea>
                <div id="Message_note"></div>
                <br />
                <input type="button" value="Send Request" onclick="checkValidation();"  /></font>

            </div><br /><br /><div align="center"><font color="#FF0000">Powered by</font> <a href="http://www.smsgatewaycenter.com/" title="SMS Gateway" target="_blank"><font color="#0000FF">SmsGatewayCenter.com</a></font></div>
        </td>
    </tr>
</table>
</div>
<!-- popup ends -->


</body>
</html>
