
	function open_window(link,w,h) //opens new window
	{
		var win = "width="+w+",height="+h+",menubar=no,location=no,resizable=yes,scrollbars=yes";
		newWin = window.open(link,'newWin',win);
		newWin.focus();
	}

	function confirmDelete() //unsubscription confirmation
	{
		temp = window.confirm('{/literal}{$smarty.const.QUESTION_UNSUBSCRIBE}{literal}');
		if (temp) //delete
		{
			window.location="index.php?killuser=yes";
		}
	}

	function validate_custinfo() //validate customer information
	{
		if (document.custinfo_form.first_name.value=="" || document.custinfo_form.last_name.value=="")
		{
			alert("{/literal}{$smarty.const.ERROR_INPUT_NAME}{literal}");
			return false;
		}
		if (document.custinfo_form.email.value=="")
		{
			alert("{/literal}{$smarty.const.ERROR_INPUT_EMAIL}{literal}");
			return false;
		}
		if (document.custinfo_form.country.value=="")
		{
			alert("{/literal}{$smarty.const.ERROR_INPUT_COUNTRY}{literal}");
			return false;
		}
		if (document.custinfo_form.state.value=="")
		{
			alert("{/literal}{$smarty.const.ERROR_INPUT_STATE}{literal}");
			return false;
		}
		if (document.custinfo_form.zip.value=="")
		{
			alert("{/literal}{$smarty.const.ERROR_INPUT_ZIP}{literal}");
			return false;
		}
		if (document.custinfo_form.city.value=="")
		{
			alert("{/literal}{$smarty.const.ERROR_INPUT_CITY}{literal}");
			return false;
		}

		reg = /[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?/;
           if (!document.custinfo_form.email.value.match(reg))
           {           	alert("Пожалуйста, введите свой настоящий e-mail"); document.getElementById('email').value=""; return false;
           	}



		return true;
	}
