<!--
// Tell a friend
function tell_a_friend()
{
	var x = document.form1;
	var error = "";
	var your_name_reg = /^([a-zA-Z]){3,10}$/;
	var your_email_reg = /([a-z0-9]){1,30}([0-9]|\.|-|_)?([a-z0-9]){1,30}@[a-z0-9]{2,20}\.(([a-z]){2,4}|([a-z]){2,3}(\.([a-z]){2})?)$/;
	//
	if(!your_email_reg.test(x.your_email.value))
	{
		error = error + "Incorrect email \n";
	}
	//
	if(!your_name_reg.test(x.your_name.value))
	{
		error = error + "Incorrect name \n";
	}
	//
	if(error)
	{
		alert(error);
	}
	else
	{

		x.submit();
	}
}
//
// Insert sms text
function add_sms(sms_text)
{
	if(parent.second.document.getElementById("sta_geo") && parent.second.form1.sta_geo)
	{
		if(parent.second.form1.sta_geo.value == "geo")
		{
			parent.second.form1.sms_geo.value = sms_text;
		}
		else
		{
			parent.second.location = "../pages/sms_geo.php";
		}
	}
	else
	{
		parent.second.location = "../pages/sms_geo.php";
	}
}
//
// Send your sms
function sms_st()
{
	var x = document.form1;
	var error = "";
	var sms_type = x.sms_type.options[form1.sms_type.selectedIndex].value;
	var your_name_reg = /^([a-zA-Z]){3,10}$/;
	var sms_geo_reg = /^([a-zA-Z0-9]|!|@|#|\$|%|\^|&|\*|\(|\)|-|_|\+|=|\/|,|\.|<|>|\?|:|;|\s){7,200}$/;

	if(x.your_name.value.indexOf("avtori")!=-1)
	{
		error = error + "Author name\n";
	}
	if(sms_type == "00")
	{
		error = error + "Select sms type\n";
	}
	//
	if(!your_name_reg.test(x.your_name.value))
	{
		error = error + "Incorrect name\n";
	}
	//
	if(!sms_geo_reg.test(x.sms_geo.value))
	{
		error = error + "Delete in SMS text (`~{}[]|\"') symbols (min 7 symbols)\n";
	}
	//
	var sms_sim = 145;
	xt_result = document.form1.sms_geo_result.value;
	xtrl = xt_result.length;
	if(xtrl > sms_sim)
	{
		error = error + "SMS text is length\n";
	}
	//
	if(error)
	{
		alert(error);
	}
	else
	{
		text_replace_st();
		x.submit();
	}

}

// Add sms
function text_replace_st()
{
	//
	nt_result = document.form1.your_name_result.value;
	nt = document.form1.your_name.value;
	document.form1.your_name_result.value = nt;
	//
	xt_result = document.form1.sms_geo_result.value;
	xt = document.form1.sms_geo.value;

	var sms_sim = 145;
	document.form1.sms_geo_result.value = xt;
	xtrl = xt_result.length;
	//alert(xtrl);
	snr = sms_sim - xtrl;
	document.form1.symbols_number.value = snr;
	if(snr < 0)
	{
		document.form1.sms_geo.style.backgroundColor = "#FF0000";
	}
	else
	{
		document.form1.sms_geo.style.backgroundColor = "#16C2FE";
	}
	
}
//
// Forgotten
function forgotten()
{
	var x = document.form1;
	var error = "";
	var your_email_reg = /([a-z0-9]){1,30}([0-9]|\.|-|_)?([a-z0-9]){1,30}@[a-z0-9]{2,20}\.(([a-z]){2,4}|([a-z]){2,3}(\.([a-z]){2})?)$/;
	//
	if(!your_email_reg.test(x.your_email.value))
	{
		error = error + "Incorrect email \n";
	}
	//
	if(error)
	{
		alert(error);
	}
	else
	{

		x.submit();
	}
}
//
// Add number
function add_number()
{
	var x = document.form1;
	var error = "";

	var prefix = x.prefix.options[form1.prefix.selectedIndex].value;
	var prefixindex = x.prefix.options[form1.prefix.selectedIndex].index;
	var your_name_reg = /^([a-zA-Z]){3,10}$/;
	var your_surname_reg = /^([a-zA-Z]){3,20}$/;
	var mobile_number_reg = /^([0-9]){3,10}$/;
	var bd_d_reg = /^(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/;
	var bd_m_reg = /^(0[1-9]|1[0-2])$/;
	var bd_y_reg = /^(195[0-9]|196[0-9]|197[0-9]|198[0-9]|199[0-5])$/;
	if(prefixindex != 0)
	{
		var prefixindex = prefixindex - 1;
	}
	var counti = "counti"+prefixindex;
	counti = counti.toString();
	var countx = document.forms["form1"].elements[counti].value;

	//
	if(!your_name_reg.test(x.your_name.value))
	{
		error = error + "Incorrect name\n";
	}
	//
	//
	if(!your_surname_reg.test(x.your_surname.value))
	{
		error = error + "Incorrect surname\n";
	}
	//
	//
	if(prefix == "00")
	{
		error = error + "GSM Operator\n";
	}
	//
	//
	if(x.mobile_number.value.length != countx)
	{
		error = error + "Enter to mobile number "+countx+" simbols\n";
	}
	//
	if(!mobile_number_reg.test(x.mobile_number.value))
	{
		error = error + "Incorrect mobile number\n";
	}
	//
	if(x.bd_day.value != "" || x.bd_month.value != "" || x.bd_year.value != "")
	{
		//
		if(!bd_d_reg.test(x.bd_day.value))
		{
			error = error + "Incorrect B.D. day\n";
		}
		//
		//
		if(!bd_m_reg.test(x.bd_month.value))
		{
			error = error + "Incorrect B.D. month\n";
		}
		//
		//
		if(!bd_y_reg.test(x.bd_year.value))
		{
			error = error + "Incorrect B.D. year [1950-1995]\n";
		}
	}
	//
	if(x.bd_day.value==31)
	{
		mes = x.bd_month.value;
		switch(mes)
		{
			case "09": error = error + "Incorrect date\n"; break;
			case "11": error = error + "Incorrect date\n"; break;
			case "02": error = error + "Incorrect date\n"; break;
			case "04": error = error + "Incorrect date\n"; break;
			case "06": error = error + "Incorrect date\n"; break;
		}
	}
    //
	if(x.bd_month.value == 02)
	{
		if(x.bd_day.value == 29 || x.bd_day.value == 30)
		{
			error = error + "Incorrect date\n";
		}
	}
	//
	//
	if(error)
	{
		alert(error);
	}
	else
	{
		var xx = confirm('Add number ?','');
		if(xx)
		{
			x.submit();
		}
	}
}

// Delete number
function delete_number()
{
	var x = document.form1;
	var error = "";
	//
	if(x.sms_user.options[form1.sms_user.selectedIndex].value == "00")
	{
		error = error + "Select user\n";
	}
	if(error)
	{
		alert(error);
	}
	else
	{
		var xx = confirm('Delete this user ?','');
		if(xx)
		{
			x.submit();
		}
	}
	//
}
//
function update_register()
{
	var x = document.form1;
	var error = "";
	var sex = x.sex.options[form1.sex.selectedIndex].value;
	var your_name_reg = /^([a-zA-Z]){3,10}$/;
	var your_surname_reg = /^([a-zA-Z]){3,20}$/;
	var your_email_reg = /([a-z0-9]){1,30}([0-9]|\.|-|_)?([a-z0-9]){1,30}@[a-z0-9]{2,20}\.(([a-z]){2,4}|([a-z]){2,3}(\.([a-z]){2})?)$/;
	var password_reg = /^([a-z0-9]){8,20}$/;
	var bd_d_reg = /^(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/;
	var bd_m_reg = /^(0[1-9]|1[0-2])$/;
	var bd_y_reg = /^(195[0-9]|196[0-9]|197[0-9]|198[0-9]|199[0-5])$/;

	//
	if(!your_name_reg.test(x.your_name.value))
	{
		error = error + "Incorrect name\n";
	}
	//
	//
	if(!your_surname_reg.test(x.your_surname.value))
	{
		error = error + "Incorrect surname\n";
	}
	//
	//
	if(!your_email_reg.test(x.your_email.value))
	{
		error = error + "Incorrect email\n";
	}
	//
	//
	if(!password_reg.test(x.password1.value))
	{
		error = error + "Password (min 8 symbols) [a-z][0-9]\n";
	}
	//
	//
	if(!password_reg.test(x.password2.value))
	{
		error = error + "Password 2 (min 8 symbols) [a-z][0-9]\n";
	}
	//
	//
	if(x.password1.value != x.password2.value)
	{
		error = error + "Incorrect password 2\n";
	}
	//
	//
	if(sex == "00")
	{
		error = error + "Select male or female\n";
	}
	//
	//
	if(!bd_d_reg.test(x.bd_day.value))
	{
		error = error + "Incorrect B.D. day\n";
	}
	//
	//
	if(!bd_m_reg.test(x.bd_month.value))
	{
		error = error + "Incorrect B.D. month\n";
	}
	//
	//
	if(!bd_y_reg.test(x.bd_year.value))
	{
		error = error + "Incorrect B.D. year [1950-1995]\n";
	}
	//
	if(x.bd_day.value==31)
	{
		mes = x.bd_month.value;
		switch(mes)
		{
			case "09": error = error + "Incorrect date\n"; break;
			case "11": error = error + "Incorrect date\n"; break;
			case "02": error = error + "Incorrect date\n"; break;
			case "04": error = error + "Incorrect date\n"; break;
			case "06": error = error + "Incorrect date\n"; break;
		}
	}
    //
	if(x.bd_month.value == 02)
	{
		if(x.bd_day.value == 29 || x.bd_day.value == 30)
		{
			error = error + "Incorrect date\n";
		}
	}
	//
	if(x.with_name.options[form1.with_name.selectedIndex].value == "00")
	{
		error = error + "Select sms with name\n";
	}
	//
	if(x.with_email.options[form1.with_email.selectedIndex].value == "00")
	{
		error = error + "Select sms with email\n";
	}
	if(error)
	{
		alert(error);
	}
	else
	{
		var xx = confirm('Change info ?','');
		if(xx)
		{
			x.submit();
		}
	}
}
//
// Text replace
function text_replace_su()
{
	//
	xt_result = document.form1.sms_geo_result.value;
	xt = document.form1.sms_geo.value;
	for(i=0;i<150;i++)
	{
		xt = xt.replace('x','h');
		//xt = xt.replace('qs','x');
		xt = xt.replace('q','k');
		xt = xt.replace('C','ch');
		xt = xt.replace('w','c');
		xt = xt.replace('W','ch');
		xt = xt.replace('R','g');
		xt = xt.replace('T','t');
		xt = xt.replace('y','k');
		//xt = xt.replace('f','p');
		xt = xt.replace('J','zh');
		xt = xt.replace('Z','dz');
		xt = xt.replace('S','sh');
	}
	
	var sms_sim = 145;
	document.form1.sms_geo_result.value = xt;
	xtrl = xt_result.length;
	snr = sms_sim - xtrl;
	document.form1.symbols_number.value = snr;
	if(snr < 0)
	{
		document.form1.sms_geo.style.backgroundColor = "#FF0000";
	}
	else
	{
		document.form1.sms_geo.style.backgroundColor = "#16C2FE";
	}
	
}
//
// Send to user
function send_to_user()
{
	var x = document.form1;
	var error = "";
	var sms_user = x.sms_user.options[form1.sms_user.selectedIndex].value;
	var sms_geo_reg = /^([a-zA-Z0-9]|!|@|#|\$|%|\^|&|\*|\(|\)|-|_|\+|=|\/|,|\.|<|>|\?|:|;|\s){7,200}$/;
	//
	nt_result = document.form1.your_name_result.value;
	nt = document.form1.your_name.value;
	for(i=0;i<150;i++)
	{
		nt = nt.replace('x','h');
		//nt = nt.replace('qs','x');
		nt = nt.replace('q','k');
		nt = nt.replace('w','c');
		nt = nt.replace('W','ch');
		nt = nt.replace('R','g');
		nt = nt.replace('T','t');
		nt = nt.replace('y','k');
		//nt = nt.replace('f','p');
		nt = nt.replace('J','zh');
		nt = nt.replace('Z','dz');
		nt = nt.replace('S','sh');
		nt = nt.replace('C','ch');
	}

	document.form1.your_name_result.value = nt;
	//
	if(sms_user == "00")
	{
		error = error + "Select sms user\n";
	}
	//
	if(!sms_geo_reg.test(x.sms_geo.value))
	{
		error = error + "Delete in SMS text (`~{}[]|\"') symbols (min 7 symbols)\n";
	}
	//
	var sms_sim = 145;
	xt_result = document.form1.sms_geo_result.value;
	xtrl = xt_result.length;
	if(xtrl > sms_sim)
	{
		error = error + "SMS text is length\n";
	}
	//
	if(error)
	{
		alert(error);
	}
	else
	{
		text_replace_su();
		x.submit();
	}

}
//
// Address book
function address_book()
{
	var x = document.form1;
	var error = "";
	var your_email_reg = /([a-z0-9]){1,30}([0-9]|\.|-|_)?([a-z0-9]){1,30}@[a-z0-9]{2,20}\.(([a-z]){2,4}|([a-z]){2,3}(\.([a-z]){2})?)$/;
	var password_reg = /^([a-z0-9]){8,20}$/;
	//
	//
	if(!your_email_reg.test(x.your_email.value))
	{
		error = error + "Incorrect email\n";
	}
	//
	//
	if(!password_reg.test(x.password1.value))
	{
		error = error + "Password (min 8 symbols) [a-z][0-9]\n";
	}
	//
	//
	if(error)
	{
		alert(error);
	}
	else
	{
		x.submit();
	}
}

// Register
function register()
{
	var x = document.form1;
	var error = "";
	var sex = x.sex.options[form1.sex.selectedIndex].value;
	var your_name_reg = /^([a-zA-Z]){3,10}$/;
	var your_surname_reg = /^([a-zA-Z]){3,20}$/;
	var your_email_reg = /([a-z0-9]){1,30}([0-9]|\.|-|_)?([a-z0-9]){1,30}@[a-z0-9]{2,20}\.(([a-z]){2,4}|([a-z]){2,3}(\.([a-z]){2})?)$/;
	var password_reg = /^([a-z0-9]){8,20}$/;
	var bd_d_reg = /^(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/;
	var bd_m_reg = /^(0[1-9]|1[0-2])$/;
	var bd_y_reg = /^(195[0-9]|196[0-9]|197[0-9]|198[0-9]|199[0-5])$/;

	//
	if(!your_name_reg.test(x.your_name.value))
	{
		error = error + "Incorrect name\n";
	}
	//
	//
	if(!your_surname_reg.test(x.your_surname.value))
	{
		error = error + "Incorrect surname\n";
	}
	//
	//
	if(!your_email_reg.test(x.your_email.value))
	{
		error = error + "Incorrect email\n";
	}
	//
	//
	if(!password_reg.test(x.password1.value))
	{
		error = error + "Password (min 8 symbols) [a-z][0-9]\n";
	}
	//
	//
	if(!password_reg.test(x.password2.value))
	{
		error = error + "Password 2 (min 8 symbols) [a-z][0-9]\n";
	}
	//
	//
	if(x.password1.value != x.password2.value)
	{
		error = error + "Incorrect password 2\n";
	}
	//
	//
	if(sex == "00")
	{
		error = error + "Select male or female\n";
	}
	//
	//
	if(!bd_d_reg.test(x.bd_day.value))
	{
		error = error + "Incorrect B.D. day\n";
	}
	//
	//
	if(!bd_m_reg.test(x.bd_month.value))
	{
		error = error + "Incorrect B.D. month\n";
	}
	//
	//
	if(!bd_y_reg.test(x.bd_year.value))
	{
		error = error + "Incorrect B.D. year [1950-1995]\n";
	}
	//
	if(x.bd_day.value==31)
	{
		mes = x.bd_month.value;
		switch(mes)
		{
			case "09": error = error + "Incorrect date\n"; break;
			case "11": error = error + "Incorrect date\n"; break;
			case "02": error = error + "Incorrect date\n"; break;
			case "04": error = error + "Incorrect date\n"; break;
			case "06": error = error + "Incorrect date\n"; break;
		}
	}
    //
	if(x.bd_month.value == 02)
	{
		if(x.bd_day.value == 29 || x.bd_day.value == 30)
		{
			error = error + "Incorrect date\n";
		}
	}
	//


	if(error)
	{
		alert(error);
	}
	else
	{
		x.submit();
	}
}
//
// Send geo
function send_email()
{
	var x = document.form1;
	var error = "";
	var reg_email = /([a-z0-9]){1,30}([0-9]|\.|-|_)?([a-z0-9]){1,30}@[a-z0-9]{2,20}\.(([a-z]){2,4}|([a-z]){2,3}(\.([a-z]){2})?)$/;

	//
	if(!reg_email.test(x.email_to.value))
	{
		error = error + "Incorrect email\n";
	}
	//
	if(x.your_subject.value != "")
	{
		if(x.your_subject.value.length < 3)
		{
			error = error + "Your subject length\n";
		}
	}
	//
	if(x.email_from.value != "  Your email")
	{
		if(x.email_from.value != "")
		{
			if(!reg_email.test(x.email_from.value))
			{
				error = error + "Incorrect your email\n";
			}
		}
	}
	//
	if(x.email_text.value.length < 5)
	{
		error = error + "Text length\n";
	}
	//
	var sms_sim = 500;
	xt_result = document.form1.email_text_result.value;
	xtrl = xt_result.length;
	if(xtrl > sms_sim)
	{
		error = error + "Email text is length\n";
	}
	//
	if(error)
	{
		alert(error);
	}
	else
	{
		text_replace_email();
		x.submit();
	}

}
/// end
// Text replace email
function text_replace_email()
{
	
	nt_result = document.form1.your_subject_result.value;
	nt = document.form1.your_subject.value;
	document.form1.your_subject_result.value = nt;
	//
	xt_result = document.form1.email_text_result.value;
	xt = document.form1.email_text.value;
	document.form1.email_text_result.value = xt;
	//
	var sms_sim = 500;
	xtrl = xt.length;
	snr = sms_sim - xtrl;
	document.form1.symbols_number.value = snr;
	if(snr < 0)
	{
		document.form1.email_text.style.backgroundColor = "#FF0000";
	}
	else
	{
		document.form1.email_text.style.backgroundColor = "#16C2FE";
	}
	
}
// Onchange
function onchange_max()
{
	var x = document.form1;
	var prefixindex = x.prefix.options[form1.prefix.selectedIndex].index;
	if(prefixindex != 0)
	{
		var prefixindex = prefixindex - 1;
	}
	var counti = "counti"+prefixindex;
	counti = counti.toString();
	var countx = document.forms["form1"].elements[counti].value;
	//
	x.mobile_number.setAttribute('maxlength', countx);
	//alert(countx);
}
// Send eng
function send_eng()
{
	var x = document.form1;
	var error = "";
	var prefix = x.prefix.options[form1.prefix.selectedIndex].value;
	var prefixindex = x.prefix.options[form1.prefix.selectedIndex].index;
	var mobile_number_reg = /^([0-9]){3,10}$/;
	var your_name_reg = /^([a-zA-Z]){3,10}$/;
	var sms_geo_reg = /^([a-zA-Z0-9]|!|@|#|\$|%|\^|&|\*|\(|\)|-|_|\+|=|\/|,|\.|<|>|\?|:|;|\s){7,200}$/;
	if(prefixindex != 0)
	{
		var prefixindex = prefixindex - 1;
	}
	var counti = "counti"+prefixindex;
	counti = counti.toString();
	var countx = document.forms["form1"].elements[counti].value;
	//var countxb = document.getElementById('counti'+prefixindex).value;
	//alert(document.forms["form1"].elements[counti].value);
	//alert(countx);
	//alert(counti);
	//
	if(prefix == "00")
	{
		error = error + "GSM Operator\n";
	}
	//
	if(x.your_name.value.indexOf("Name")!=-1)
	{
		error = error + "Your name\n";
	}
	if(x.mobile_number.value.indexOf("Number")!=-1)
	{
		error = error + "Mobile number\n";
	}
	//
	if(x.mobile_number.value.length != countx)
	{
		error = error + "Enter to mobile number "+countx+" simbols\n";
	}
	//
	if(!mobile_number_reg.test(x.mobile_number.value))
	{
		error = error + "Incorrect mobile number\n";
	}
	//
	if(!your_name_reg.test(x.your_name.value))
	{
		error = error + "Incorrect name\n";
	}
	//
	if(!sms_geo_reg.test(x.sms_eng.value))
	{
		error = error + "Delete in SMS text (`~{}[]|\"') symbols (min 7 simbols)\n";
	}
	//
	var sms_sim = 145;
	xt_result = document.form1.sms_eng_result.value;
	xtrl = xt_result.length;
	if(xtrl > sms_sim)
	{
		error = error + "SMS text is length\n";
	}
	//
	if(error)
	{
		alert(error);
	}
	else
	{
		text_replace_eng();
		x.submit();
	}

}
// Text replace
function text_replace_eng()
{
	
	nt_result = document.form1.your_name_result.value;
	nt = document.form1.your_name.value;
	document.form1.your_name_result.value = nt;
	//
	xt_result = document.form1.sms_eng_result.value;
	xt = document.form1.sms_eng.value;
	document.form1.sms_eng_result.value = xt;
	//
	var sms_sim = 145;
	xtrl = xt.length;
	snr = sms_sim - xtrl;
	document.form1.symbols_number.value = snr;
	if(snr < 0)
	{
		document.form1.sms_eng.style.backgroundColor = "#FF0000";
	}
	else
	{
		document.form1.sms_eng.style.backgroundColor = "#16C2FE";
	}
	
}

// Insert holiday text
function holiday(sms_text)
{
	if(parent.second.document.getElementById("sta_geo") && parent.second.form1.sta_geo)
	{
		if(parent.second.form1.sta_geo.value == "geo")
		{
			parent.second.form1.sms_geo.value = sms_text;
		}
		else
		{
			parent.second.location = "../pages/sms_geo.php";
		}
	}
	else
	{
		parent.second.location = "../pages/sms_geo.php";
	}
}

// Insert holiday text
function bd_day(sms_text, user_name)
{
	if(parent.second.document.getElementById("sta_geo") && parent.second.form1.sta_geo)
	{
		if(parent.second.form1.sta_geo.value == "geo")
		{
			parent.second.form1.sms_geo.value = sms_text;

			for(i=0;i<parent.second.form1.sms_user.length;i++)
			{
				if(parent.second.form1.sms_user.options[i].text == user_name)
				{
					parent.second.form1.sms_user.options[i].selected = true;
				}
			}
		}
		else
		{
			parent.second.location = "../pages/sms_geo.php";
		}
	}
	else
	{
		parent.second.location = "../pages/sms_geo.php";
	}
}
//
// Text replace
function text_replace()
{
	//
	nt_result = document.form1.your_name_result.value;
	nt = document.form1.your_name.value;
	for(i=0;i<150;i++)
	{
		nt = nt.replace('x','h');
		//nt = nt.replace('qs','x');
		nt = nt.replace('q','k');
		nt = nt.replace('w','c');
		nt = nt.replace('W','ch');
		nt = nt.replace('R','g');
		nt = nt.replace('T','t');
		nt = nt.replace('y','k');
		//nt = nt.replace('f','p');
		nt = nt.replace('J','zh');
		nt = nt.replace('Z','dz');
		//nt = nt.replace('S','sh');
		//nt = nt.replace('S','sh');
		nt = nt.replace('S','sh');
		nt = nt.replace('C','ch');
	}

	document.form1.your_name_result.value = nt;
	//
	xt_result = document.form1.sms_geo_result.value;
	xt = document.form1.sms_geo.value;
	for(i=0;i<150;i++)
	{
		xt = xt.replace('x','h');
		//xt = xt.replace('qs','x');
		xt = xt.replace('q','k');
		xt = xt.replace('C','ch');
		xt = xt.replace('w','c');
		xt = xt.replace('W','ch');
		xt = xt.replace('R','g');
		xt = xt.replace('T','t');
		xt = xt.replace('y','k');
		//xt = xt.replace('f','p');
		xt = xt.replace('J','zh');
		xt = xt.replace('Z','dz');
		xt = xt.replace('S','sh');
	}
	
	var sms_sim = 145;
	document.form1.sms_geo_result.value = xt;
	xtrl = xt_result.length;

	snr = sms_sim - xtrl;
	document.form1.symbols_number.value = snr;
	if(snr < 0)
	{
		document.form1.sms_geo.style.backgroundColor = "#FF0000";
	}
	else
	{
		document.form1.sms_geo.style.backgroundColor = "#16C2FE";
	}
	
}

// Send geo
function send_geo()
{
	var x = document.form1;
	var error = "";
	var prefix = x.prefix.options[form1.prefix.selectedIndex].value;
	var prefixindex = x.prefix.options[form1.prefix.selectedIndex].index;
	var mobile_number_reg = /^([0-9]){3,10}$/;
	var your_name_reg = /^([a-zA-Z]){3,10}$/;
	var sms_geo_reg = /^([a-zA-Z0-9]|!|@|#|\$|%|\^|&|\*|\(|\)|-|_|\+|=|\/|,|\.|<|>|\?|:|;|\s){7,200}$/;
	if(prefixindex != 0)
	{
		var prefixindex = prefixindex - 1;
	}
	var counti = "counti"+prefixindex;
	counti = counti.toString();
	var countx = document.forms["form1"].elements[counti].value;
	//var countxb = document.getElementById('counti'+prefixindex).value;
	//alert(document.forms["form1"].elements[counti].value);
	//alert(countx);
	//alert(counti);
	//
	if(prefix == "00")
	{
		error = error + "GSM Operator\n";
	}
	//
	if(x.your_name.value.indexOf("saxeli")!=-1)
	{
		error = error + "Your name\n";
	}
	if(x.mobile_number.value.indexOf("nomeri")!=-1)
	{
		error = error + "Mobile number\n";
	}
	//
	if(x.mobile_number.value.length != countx)
	{
		error = error + "Enter to mobile number "+countx+" simbols\n";
	}
	if(!mobile_number_reg.test(x.mobile_number.value))
	{
		error = error + "Incorrect mobile number\n";
	}
	//
	if(!your_name_reg.test(x.your_name.value))
	{
		error = error + "Incorrect name\n";
	}
	//
	if(!sms_geo_reg.test(x.sms_geo.value))
	{
		error = error + "Delete in SMS text (`~{}[]|\"') symbols (min 7 symbols)\n";
	}
	//
	var sms_sim = 145;
	xt_result = document.form1.sms_geo_result.value;
	xtrl = xt_result.length;
	if(xtrl > sms_sim)
	{
		error = error + "SMS text is length\n";
	}
	//
	if(error)
	{
		alert(error);
	}
	else
	{
		text_replace();
		x.submit();
	}

}
// Input empty
function input_empty(e_name, e_value)
{
	if(document.forms['form1'].elements[e_name].value.indexOf(e_value)!=-1)
	{
		document.forms['form1'].elements[e_name].value = "";
	}
}
// Add Favorite
userAgent = navigator.userAgent;
ver = parseInt(navigator.appVersion)

ie6 = (ver > 3  && navigator.appName != "Netscape" && userAgent.indexOf("MSIE")!=-1 && userAgent.indexOf("Opera")==-1)?1:0
opf = (ver > 3  && navigator.appName != "Netscape" && userAgent.indexOf("MSIE")!=-1 && userAgent.indexOf("Opera")!=-1)?1:0
nsf = (ver > 3  && navigator.appName == "Netscape")?1:0

function addToFavorite()
{
	if(ie6)
	{
		window.external.addFavorite(top.window.location.href,top.window.document.title);
	}
	else if(opf)
	{
		alert("Please enter  [CTRL + T]");
	}
	else if(nsf)
	{
		alert("Please enter  [CTRL + D]");
	}
	else
	{
	alert("Your browser doesn't support this function");
	}
}
//
function link(page_num)
{
	page_first = "";
	page_second = "";
	folder = "pages/";
	switch (page_num) 
	{
		case '1': page_first = 'home.php'; page_second = 'sms_geo.php'; break;
		case '2': page_first = ''; page_second = 'sms_eng.php'; break;
		case '3': page_first = ''; page_second = 'send_email.php'; break;
		case '4': page_first = ''; page_second = 'login.php'; break;
		case '5': page_first = 'registration.php'; page_second = ''; break;
		case '6': page_first = 'sms_text.php'; page_second = ''; break;
		case '7': page_first = 'add_your_sms.php'; page_second = ''; break;
		case '8': page_first = 'sms_statics.php'; page_second = ''; break;
		case '9': page_first = 'tell_a_friend.php'; page_second = ''; break;
		case '10': page_first = 'links.php'; page_second = ''; break;
		case '11': page_first = 'web_advertisement.php'; page_second = ''; break;
		case '12': page_first = 'contact.php'; page_second = ''; break;
		default: page_first = 'home.php'; page_second = 'sms_geo.php'; break;
	}
	//
	if(page_first)
	{
		parent.first.location = folder + page_first;
	}
	//
	if(page_second)
	{
		if(parent.second.location.href.indexOf("book.php")!=-1 && page_first == "home.php")
		{
		}
		else
		{
			parent.second.location = folder + page_second;
		}
	}
	//
}
//
function img_view(img_name, img_pos)
{
	if(document.images)
	{
		document.images['b'+img_name].src = eval("img_"+img_name+"_"+img_pos+".src;");
	}
}

if(document.images)
{
//
	img_1_1 = new Image(209,24);
	img_1_1.src = "img/button/1_1.jpg";

	img_1_2 = new Image(209,24);
	img_1_2.src = "img/button/1_2.jpg";
//
	img_2_1 = new Image(209,24);
	img_2_1.src = "img/button/2_1.jpg";

	img_2_2 = new Image(209,24);
	img_2_2.src = "img/button/2_2.jpg";
//
	img_3_1 = new Image(209,24);
	img_3_1.src = "img/button/3_1.jpg";

	img_3_2 = new Image(209,24);
	img_3_2.src = "img/button/3_2.jpg";
//
	img_4_1 = new Image(209,24);
	img_4_1.src = "img/button/4_1.jpg";

	img_4_2 = new Image(209,24);
	img_4_2.src = "img/button/4_2.jpg";
//
	img_5_1 = new Image(209,24);
	img_5_1.src = "img/button/5_1.jpg";

	img_5_2 = new Image(209,24);
	img_5_2.src = "img/button/5_2.jpg";
//
	img_6_1 = new Image(209,24);
	img_6_1.src = "img/button/6_1.jpg";

	img_6_2 = new Image(209,24);
	img_6_2.src = "img/button/6_2.jpg";
//
	img_7_1 = new Image(209,24);
	img_7_1.src = "img/button/7_1.jpg";

	img_7_2 = new Image(209,24);
	img_7_2.src = "img/button/7_2.jpg";
//
	img_8_1 = new Image(209,24);
	img_8_1.src = "img/button/8_1.jpg";

	img_8_2 = new Image(209,24);
	img_8_2.src = "img/button/8_2.jpg";
//
	img_9_1 = new Image(209,24);
	img_9_1.src = "img/button/9_1.jpg";

	img_9_2 = new Image(209,24);
	img_9_2.src = "img/button/9_2.jpg";
//
	img_10_1 = new Image(209,24);
	img_10_1.src = "img/button/10_1.jpg";

	img_10_2 = new Image(209,24);
	img_10_2.src = "img/button/10_2.jpg";
//
	img_11_1 = new Image(209,24);
	img_11_1.src = "img/button/11_1.jpg";

	img_11_2 = new Image(209,24);
	img_11_2.src = "img/button/11_2.jpg";
//
	img_12_1 = new Image(209,24);
	img_12_1.src = "img/button/12_1.jpg";

	img_12_2 = new Image(209,24);
	img_12_2.src = "img/button/12_2.jpg";
//
}

// popup
function open_popup(vwidth, vheight, page)
{
	wind = window.open(page,'','width='+vwidth+',height='+vheight+',left=0,top=0,status=0,menubar=0,resizable=0');
}
//-->