﻿<!--
var fj;
switch (g_LangID)
{
case 1:	// Russian
	fj = {
		all:				"Все поля являются обязательными для заполнения!",
		login:				"При вводе Логина и Пароля допускаются следующие символы: A-Z, a-z, 0-9, _",
		confirm:			"Пароль не совпадает с подтверждением!\n\nПожалуйста, введите его аккуратно.",
		email:				"Введите корректный e-mail",
		name:				"При вводе Имени допускаются следующие символы: A-Z, a-z, ', -",
		gender:				"Укажите Ваш пол!",
		birth:				"Укажите дату рождения!",
		city:				"Укажите город!",
		meet:				"Укажите с кем Вы хотите познакомиться!",
		agreement:			"Вы должны прочесть и согласиться с нашими Правилами и Требованиями.",
		vip_reg1:           "В данный момент доступна только VIP регистрация!"
	};
	break;
case 2:	// Spanish
	fj = {
		all:				"¡Rellenar todos los espacios!",
		login:				"Al introducir el Nick y contraseña se admiten los dígitos: A-Z, a-z, 0-9, _",
		confirm:			"La contraseña no coincide con la confirmación.\n\nPor favor, insértelo más atentamente.",
		email:				"Introduzca el correo electrónico correcto.",
		name:				"Al introducir el nombre se admiten los dígitos: A-Z, a-z, ', -",
		gender:				"Indique su sexo.",
		birth:				"Indique fecha de nacimiento.",
		city:				"Indique la ciudad.",
		meet:				"Indique a quién quiere conocer.",
		agreement:			"Tiene que leer y admitir nuestras Condiciones y Exigencias.",
		vip_reg1:           "Only the VIP registration is available now!"
	};
	break;
case 3:	// Romanian
	fj = {
		all:				"Toate cîmpurile sunt obligatorii pentru completare!",
		login:				"La formarea Login-ului şi Parolei folosiţi simbolurile: A-Z, a-z, 0-9, _",
		confirm:			"Parola nu coiincide cu parola de confirmare!\n\nVă rugăm, întrduceţi atent simbolurile.",
		email:				"Întroduceţi atent adresa email",
		name:				"La formarea Numeului folosiţi simbolurile: A-Z, a-z, ', -",
		gender:				"Indicaţi sexul Dv!",
		birth:				"Indicaţi data naşterii!",
		city:				"Indicaţi oraşul!",
		meet:				"Indicaţi, cu cine doriţi să faceţi cunoştinţă!",
		agreement:			"E necesar să citiţi şi să acceptaţi Termeni şi Condiţii.",
		vip_reg1:           "Only the VIP registration is available now!"
	};
	break;
default:
	fj = {
		all:				"All fields must be completed!",
		login:				"For entering Login and Password, the following symbols are allowed: A-Z, a-z, 0-9, _",
		confirm:			"Password does not match with confirmation!\n\nPlease, try again.",
		email:				"Enter correct e-mail",
		name:				"For entering your name, the following symbols are allowed: A-Z, a-z, ', -",
		gender:				"Specify your Gender!",
		birth:				"Specify your Birth date!",
		city:				"Select your city!",
		meet:				"Specify who you are looking for!",
		agreement:			"Please read and agree to our Rules and Requirements.",
		vip_reg1:           "Only the VIP registration is available now!"
	};
}

function CheckForm(frm)
{
	var reName		= /[^A-Za-z\'\-\ ]/g;	// "qwertyuiopasdfghjklzxcvbnm'- ";
	var reAuth		= /[^\w]/g;				// [A-Za-z0-9_];

	if (frm.name.value.replace(/ /g, "") == "" ||
		frm.login.value.replace(/ /g, "") == "" ||
		frm.password.value.replace(/ /g, "") == "" ||
		frm.email.value.replace(/ /g, "") == "")
	{
		alert(fj.all);
		return event.returnValue = false;
	}

	if (frm.login.value.match(reAuth) || frm.password.value.match(reAuth))
	{
		alert(fj.login);
		return event.returnValue = false;
	}


	if (frm.password.value != frm.re_pwd.value)
	{
		alert(fj.confirm);
		frm.re_pwd.focus();
		return event.returnValue = false;
	}

	frm.email.value = frm.email.value.replace(/ /g, "");
	if (!frm.email.value.match(/^[\w\-\.]+\@[\w][\w\-\.]+\.[a-z]{2,4}$/i))
	{
		alert(fj.email);
		frm.email.focus();
		return event.returnValue = false;
	}

	if (frm.name.value.match(reName))
	{
		alert(fj.name);
		frm.name.focus();
		return event.returnValue = false;
	}
	
    /// --- 
    /*
    if (frm.site_vip.value == '13048')
    {
        if (confirm(fj.vip_reg1))
	    {
		  return true;
	    }
	    else
	    {
	      return event.returnValue = false;
	    }
	}   
    /// --- 
    */
	if (!frm.gender[0].checked && !frm.gender[1].checked)
	{
		alert(fj.gender);
		frm.gender[0].focus();
		return event.returnValue = false;
	}
	
	if (!frm.year.selectedIndex || !frm.month.selectedIndex || !frm.day.selectedIndex)
	{
		alert(fj.birth);
		if (!frm.day.selectedIndex)
			frm.day.focus();
		else if (!frm.month.selectedIndex)
			frm.month.focus();
		else if (!frm.year.selectedIndex)
			frm.year.focus();
		return event.returnValue = false;
	}

	if (!frm.cboCity.selectedIndex)
	{
		alert(fj.city);
		if (frm.cboCity.disabled)
			if (frm.cboRegion.disabled)
				frm.cboCountry.focus();
			else
				frm.cboRegion.focus();
		else
			frm.cboCity.focus();
		return event.returnValue = false;
	}

	if (!frm.what_to_meet602.checked &&
		!frm.what_to_meet603.checked &&
		!frm.what_to_meet604.checked &&
		!frm.what_to_meet605.checked &&
		!frm.what_to_meet606.checked)
	{
		alert(fj.meet);
		frm.what_to_meet602.focus();
		return event.returnValue = false;
	}

	if (!frm.agreement.checked)
	{
		alert(fj.agreement);
		frm.agreement.focus();
		return event.returnValue = false;
	}
    
	return true;
}
//-->