/* 
 This file was generated by Dashcode.  
 You may edit this file to customize your widget or web page 
 according to the license.txt file included in the project.
 */

//
// Function: load()
// Called by HTML body element's onload event when the web application is ready to start
//
function load()
{
    dashcode.setupParts();
}

function autotab(original,destination)
{
	var destination = document.getElementById(destination);
	if (original.getAttribute && original.value.length==original.getAttribute("maxlength"))
		destination.focus();
}








function updateCharacterCount(event)
{
   var message = document.getElementById("message");
	if (message.value.length > 145)
		message.value=message.value.substring(0,145);
	document.getElementById("charactercount").innerHTML = 145 - message.value.length;

}


function sendData(event)
{
   document.getElementById("responseStatus").innerHTML = "Sending";
	window.setTimeout("sendTxt()", 100);
}

function sendTxt(event)
{
    
    //alert("Message sent");
	var request = new XMLHttpRequest();
  

5


	request.open("GET", "http://demo.monstermessaging.com/iphone_wep_app/Default.aspx?phone="+document.getElementById("npa").value+"&mesg="+document.getElementById("message").value+"&from="+document.getElementById("email").value+"&popup="+document.getElementById("popup").value,false);
    
	request.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
	request.send("phone="+document.getElementById("npa").value+"&mesg="+document.getElementById("message").value+"&popup="+document.getElementById("popup").value);
	var msgstatus = request.responseText; 
	document.getElementById("responseStatus").innerHTML = msgstatus;
	npa.value = "";
	message.value = "";
    popup.value = "";
    email.value ="";

//alert(document.getElementById("npa").value+document.getElementById("exchange").value+document.getElementById("number").value+document.getElementById("message").value+document.getElementById("popup").value);

    
}


