function sendmsgapi()
{
var custkey = _uacct;
document.write ("<div style='width:"+ _borderWidth +";border:0.1em black solid;height:auto;padding:3px 3px 3px 3px;'>");
document.write("<div id='znifeedbackdataform'>");
document.write("<form name='znifeedbackform'><table>");
document.write("<tr><td colspan='2'><div class='zni00001'>Send us your feedback:</div></td></tr>");
document.write("<tr><td><div class='zni00002'>Mobile</div></td><td><div><input type='text' class='zni00003' name='feedMobile' maxlength='10'/></div><div style='font-size:10px;color:gray;'>Only 10 digit mobile number is allowed.</div></td></tr>");
document.write("<tr><td><div class='zni00002'>Message</div></td><td><div><input type='text' class='zni00004' name='feedMsg' maxlength='100'/></div><div style='font-size:10px;color:gray;'>Maximum 100 characters are allowed.</div></td></tr>");
document.write("<tr><td colspan='2'><input type='button' class='zni00005' value='Scrap Me' onClick='checkData();'/></td></tr>");
document.write("</table></form></div>")
document.write("<div style='font-size:10px;color:blue;margin-top:5px;'>Powered by <a href='http://www.znisms.com/scrapme.html' target='_parent' style='color:green;text-decoration:underline;'>ZNISMS.com</a></div>")
document.write ("</div>");
}
function checkData()
{
var _umobile = document.znifeedbackform.feedMobile.value;
var _umsg = document.znifeedbackform.feedMsg.value;
if (_umobile.length != 10)
{
	alert("Invalid mobile number.");
}
else if(_umsg.length < 5 || _umsg.length > 100)
{
	alert("Message should be less than 100 and greater than 5 characters.")
}
else
{
		
	sURL = "http://api.znisms.com/scrapme/sendmsg.asp?toUser="+ _uacct +"&fromUser="+ _umobile +"&msg="+ _umsg ;
       var succMsg = "";
       try{
       if (navigator.appName == "Microsoft Internet Explorer")
               {
                       var oXMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
       			}
       else
               {  
      		        var oXMLHTTP = new XMLHttpRequest();
               }
      
				oXMLHTTP.open("POST", sURL , false);
    			oXMLHTTP.send("");
				feedbackResp = oXMLHTTP.responseText;
      	}
      catch(err)
      	{
      	
      			feedbackResp = "Unexpected Error, feedback not sent."+ err.name +" : "+ err.message;
		}

	document.getElementById("znifeedbackdataform").innerHTML = feedbackResp;
}
}
