function checkf(login,password,password1,email)
{ 
	if (login.value=="")
	{
		login.focus(); alert("\nВы забыли ввести Ваше имя.\n"); return false;
	}
	else 
	{
		if (password.value=="" || password1.value=="")
		{
			password.focus(); alert("\nПожалуйста, введите Ваш пароль дважды.\n"); return false;
		}
	};
	if (password.value != password1.value || password.value.length!=password1.value.length)
	{
		password1.focus();alert("\nВведенные пароли не совпадают.\n");return false;
	};
	if (email.value==""){email.focus();alert("\nВы должны указать Ваш e-mail.\n");return false;};
	if ((email.value.indexOf('@')==(-1)) || (email.value.indexOf('.') == (-1))){email.focus();alert("\nИзвините, неправильный формат адреса e-mail.\n");return false;};
	return true;
}

function checkmail(email)
{ 
	if (email.value==""){email.focus();alert("\nВы должны указать Ваш e-mail.\n");return false;};
	if ((email.value.indexOf('@')==(-1)) || (email.value.indexOf('.') == (-1))){email.focus();alert("\nИзвините, неправильный формат адреса e-mail.\n");return false;};
	return true;
}

function checklogin(login,password)
{ 
	if (login.value=="")
	{
		login.focus(); alert("\nВы забыли ввести Ваш логин.\n"); return false;
	};
	if (password.value=="")
	{
		password.focus(); alert("\nПожалуйста, введите Ваш пароль.\n"); return false;
	}
	return true;
}

function checkforum(name,title,text)
{ 
	if (name.value=="")
	{
		name.focus(); alert("\nВы забыли ввести Ваше имя.\n"); return false;
	};
	if (title.value=="")
	{
		title.focus(); alert("\nВы забыли ввести название темы.\n"); return false;
	};
	if (text.value=="")
	{
		text.focus(); alert("\nПожалуйста, введите текст.\n"); return false;
	}
	return true;
}

function openwindow(foto, descript) {
  fotowin=window.open('', 'foto', "width=640,height=480,dependent,scrollbars,resizable,menubar,top=10,left=10");
  fotowin.document.open();
  content = "";
  content += "<html><head>";
  content += "<meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>";
  content += "<title>ОАО «Мосэнерго»</title>";
  content += "<LINK REL='stylesheet' TYPE='text/css' HREF='styles/common.css'>";
  content += "</head>";
  content += "<body><table width=100% height=100% align=center class=table><tr><td align=center>";
  content += "<img src=" + foto + " border=0>";
  content += "<p style='text-align:center'>" + descript + "</p>";
  content += "</td></tr></table></body></html>";
  fotowin.document.write(content);
  fotowin.document.close();
  fotowin.focus();
}

function doNothing() {
}

function Subcribe() {
subscrwin=window.open("", "news_win", "width=250,height=250");
subscrwin.focus(); 
}

