
function wo_c(params, w, h) {
	screen_width = screen.width;
	screen_height = screen.height;
	hor_l = (screen_width/2)-200;
	hor_t = (screen_height/2)-200;
	window.open(params,'centered','toolbar=0,resizable=0,location=0,scrollbars=0,status=0,menubar=0,width='+w+',height='+h+',left='+hor_l+',top='+hor_t);
}


function wo(params, w, h) {
	screen_width = window.screen.width;
	screen_height = window.screen.height;
	hor_l = (screen_width/2)-(w/2);
	hor_t = (screen_height/2)-(h/2);

	var wnd = window.open(params,'centered','toolbar=0,resizable=0,location=0,scrollbars=0,status=1,menubar=0,width='+w+',height='+h+',left='+hor_l+',top='+hor_t);
	wnd.resizeTo(w+6,h+48);
	
}


function confirm_send() {
  return confirm("Отправить сообщение?");
}

function confirm_send_pass() {
  return confirm("Отправить пароль?");
}

function setfocus(obj) {
  obj.focus();
  obj.select();
}

function alert_empty_email(obj) {
  alert("Ваше E-mail не указан!");
  setfocus(obj);
}

function alert_empty_name(obj) {
  alert("Ваше имя не указано!");
  setfocus(obj);
}

function alert_empty_subj(obj) {
  alert("Тема сообщения не указана!");
  obj.focus();
}

function alert_empty_text(obj) {
  alert("Текст сообщения не указан!");
  setfocus(obj);
}

function checkemail(name) {
  var obj = document.getElementById(name);
  if (!obj || obj.value == '') return true;
  if ((obj.value.indexOf('@', 0) == -1) || obj.value.indexOf('.', 0) == -1) {
	   alert('Неверный E-mail адрес!');
	   obj.focus();
	   obj.select();
       return false;
  } else return true;
}


function checkfilled_name(name) {
  var obj = document.getElementById(name);
  if (!obj) return true;
  var str = obj.value;
  if (str == "") {
	 alert_empty_name(obj);
     return false;
  }
  return true
}

function checkfilled_email(name) {
  var obj = document.getElementById(name);
  if (!obj) return true;
  var str = obj.value;
  if (str == "") {
	 alert_empty_email(obj);
     return false;
  }
  return true
}

function checkfilled_text(name) {
  var obj = document.getElementById(name);
  if (!obj) return true;
  var str = obj.value;
  if (str == "") {
	 alert_empty_text(obj);
     return false;
  }
  return true
}

function checkfilled_subj(name) {
  var obj = document.getElementById(name);
  if (!obj) return true;
  if (obj.selectedIndex > 0) return true;
  alert_empty_subj(obj);
  return false;
}

function disableButton (button) {
    if (document.all || document.getElementById) {
       document.all.namedItem(button).disabled=true;
    }
}