// ----------------------------
// ----------------------------

/**
 *	
 */
function checkForm(form)
{
	//return true;

	if(form.name.value.length < 1) 
	{ 
		alert(ACTIVATION_ERROR_NAME ); 
		form.name.focus();
		return false; 
	}

	if(!checkEmail(form.email.value)) 
	{ 
		alert(ACTIVATION_ERROR_EMAIL); 
		form.email.focus();
		return false; 
	}
	
	return true;
}

// ----------------------------------------------

/**
 *	Check Email Field
 */
function checkEmail(email)
{
	re = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(\.$)/;
	re2 = /^[_\.0-9a-zA-Z-]+@[0-9a-zA-Z][\.0-9a-zA-Z-]*\.+([a-zA-Z]{2,4}|[0-9]{1,3})$/;
   	if (email.search(re) == -1 && email.search(re2) != -1) { return true; }

   	return false;
}

// ----------------------------------------------

/**
 *	Check Email Field
 */
function changeRegLang(langId)
{
	new_url = window.location.href;

	re2 = /agnitum.(\w{2,3})/;
	re2.exec(new_url);
	dom = RegExp.$1;
	
	newDom = dom;
	if(langId == "de") { newDom = "de"; }
	else if(langId == "ru") { newDom = "ru"; }
	else if(langId == "en") { newDom = "com"; }
	else if(langId == "fr") { newDom = "fr"; }

	if(newDom != dom)
	{
		re3 = new RegExp("agnitum." + dom, "");
		new_url = new_url.replace(re3, "agnitum." + newDom);
	}

	window.location.href = new_url;
}

// ----------------------------
// ----------------------------
