<!-- Toll Free SMS Script - Sliding 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>Toll Free SMS Script</title>

<style>
.fixme{	position:fixed;}
.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>
	var IE = false;
	if (navigator.appName == "Microsoft Internet Explorer"){IE = true}
	if (!IE){document.captureEvents(Event.MOUSEMOVE)}
	document.onmousemove = getMouseXY;
	var mouse_position_x = 0;
	var mouse_position_y = 0;
	var screen_height = 0;
	var screen_width = 0;
	if (IE)	
	{
		screen_height 		= document.documentElement.clientHeight;
		screen_width 		= document.documentElement.clientWidth;
	}
	else
	{
		screen_height 		= window.innerHeight;
		screen_width 		= window.innerWidth;
	}
	
	function getMouseXY(m)
	{
  		if (IE)	
		{
			 var tmpX = event.clientX;
  			 var tmpY = event.clientY;
		}	
 		else 	
		{
    		 var tmpX = m.pageX;
			 var tmpY = m.pageY;
  		}  
		if (!document.body.scrollTop)
		{
			 var iL = document.documentElement.scrollLeft;	
			 var iV = document.documentElement.scrollTop;
		}
		else 	
		{
			 var iL = document.body.scrollLeft;	
			 var iV = document.body.scrollTop;	
		}
		if (IE)	
		{
			mouse_position_x 	= tmpX ; 
			mouse_position_y 	= tmpY ;
		}
		else
		{
			mouse_position_x 	= tmpX - iL; 
			mouse_position_y 	= tmpY - iV;
		}
  	}
	
	var contact_us_click = 0;
	function contact_up_popup()
	{
		if(contact_us_click == 0)
		{
			contact_us_click = 1;
			chat_popup_function_visible();
		}
		else
		{
			contact_us_click = 0;
			chat_popup_function_hidden();
		}
	}
	function chat_popup_function_visible()
	{
		document.getElementById("chat_popup").style.left = (screen_width - 300)+"px";
		document.getElementById("chat_popup").style.top = (screen_height / 4)+"px";
		//document.getElementById("chat_popup").style.visibility = 'visible'; 
	}
	function chat_popup_function_hidden()
	{
		//document.getElementById("chat_popup").style.visibility = 'hidden'; 
		load_script();
	}
	function load_script()
	{
		document.getElementById("chat_popup").style.left = (screen_width - 30)+"px";
		document.getElementById("chat_popup").style.top = (screen_height / 4 )+"px";
	}
	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 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 send_message()
	{
		xmlhttp=GetXmlHttpObject();
		if (xmlhttp==null)
		{
			alert ("Your browser does not support XMLHTTP!");
			return;
		}
		xmlhttp.onreadystatechange=stateChangedsend_message; 
		xmlhttp.open("POST", "(PASTE THE PURCHASED URL SCRIPT HERE)?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 onload="load_script();"  >





<!-- 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; border:1; width:15px; "  >
                C<br />
                O<br />
                N<br />
                T<br />
                A<br />
                C<br />
                T<br />
                 <br />
                U<br />S
            </div>
        </td>
        <td valign="middle" >
        	<div id="form">

                Mobile No.<br />
                <input type="hidden" name="UserName" id="UserName"  size="200px" value="ABC" />
                <input type="text" name="Mobile" id="Mobile"  />
                <br />Ex. 9999999991, 919999999991, 09999999991<br />
                Message 
                <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();"  />

            </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>
