if (typeof JSON !== "object")document.write(""); var SMS = {SendSMS : function(mobile, SMSSessionKey){ return SMS.ajax("SendSMS", {mobile : mobile, SMSSessionKey : SMSSessionKey} ,SMS.getCallback(arguments, 2)); },setDate : function (a) { if(a != null && typeof a == 'object') { for (var i in a) a[i] = SMS.setDate(a[i]) } return a = a instanceof Date ? '"\\/Date(' + a.getTime() + ')\\/"' : a}, getCallback : function(a, b){ return b < a.length ? a[b] : undefined},ajax: function (a, b, c){var j = JSON.stringify(SMS.setDate(b)); var d = { contentType:'text/plain', beforeSend : function(x){ x.setRequestHeader('method', a) }, async : true, url : SMS.u, type : 'POST', dataType : 'json', data : j, success:function(e){ typeof c == 'function' && c(e) } }; if(typeof c != 'function'){ d.async = false; return JSON.parse(jQuery.ajax(d).responseText) } else jQuery.ajax(d) }, u: '/ajax/SMS.ashx'};