var iMaxMessageLength = 140;
function sendSmsValidator()
{
	return sendSmsFormIsValid();
} // sandSmsValidator
function sendSmsStart()
{
	setInterval("sendSmsTimerFunc();", 250);
} // sendSmsStart
function sendSmsTimerFunc()
{
	document.forms[1]['sendSmsSubmit'].disabled = !sendSmsFormIsValid();
} // sendSmsTimerFunc
function sendSmsFormIsValid()
{
	var result = true;
	try
	{
		var t = document.forms[1]['message'].value;
		if (/^\s+$/.test(t))
			result = false;
		var itMaxMessageLength = (/%u[\dA-F]{4}/).test(escape(t)) ? iMaxMessageLength / 2 : iMaxMessageLength;
		t = itMaxMessageLength - t.length;
		if (t == itMaxMessageLength || t < 0)
		{
			t = "<b>" + (t < 0 ? 0 : t) + "</b>";
			result = false;
		} // if
		document.getElementById('messageLength').innerHTML = t;
		t = document.forms[1]['phoneNumber'].value;
		if (!(/^\d{5}$/).test(t))
			result = false;
		t = document.forms[1]['pictureCode'].value;
		if (!(/^\d{6}$/).test(t))
			result = false;
	} // try
	catch (e)
	{} // catch
	return result;
} // sendSmsFormIsValid

try
{
	if (window.top != window)
		window.top.location.replace(location.href);
} // try
catch (e)
{
} // catch