/*-*/

var ns6=document.getElementById&&!document.all?1:0

var head="display:''"

var folder=''

function expandit(curobj) {

  folder=ns6?curobj.nextSibling.nextSibling.style:document.all[curobj.sourceIndex+1].style

  if (folder.display=="none")

    folder.display=""

  else {

    folder.display="none"

  }

}



function smile(str) {
  obj = document.SiteForm.mess;
  obj.focus();
  obj.value =obj.value + str;
}



function quoteguest(str) {
  obj = document.SiteForm.mess;
  obj.focus();
  obj.value =obj.value + '[quote] ' + str + ' [/quote]\r\n';
}



function quotenameguest(str) {
  obj = document.SiteForm.mess;
  obj.focus();
  obj.value =obj.value + '[b] ' + str + ' [/b]\r\n';
}



function inserttags(st_t, en_t) {
  obj = document.SiteForm.mess;
  obj2 = document.SiteForm;
  if ((document.selection)) {
    obj.focus();
    obj2.document.selection.createRange().text = st_t+obj2.document.selection.createRange().text+en_t;
  }
  else {
    obj.focus();
    obj.value += st_t+en_t;
  }
}



required = new Array("name", "mess", "f_antispam");
required_show = new Array("имя", "сообщение", "код с картинки");
function SendForm () {
	var i, j;
	for(j=0; j<required.length; j++) {
		for (i=0; i<document.forms[0].length; i++) {
			if (document.forms[0].elements[i].name == required[j] && document.forms[0].elements[i].value == "" ) {
				alert('Введите ' + required_show[j] + '!');
				document.forms[0].elements[i].focus();
				return false;
			}
		}
	}
	return true;
}



function Hello() {
	today = new Date()
	if ((today.getHours() < 12) && (today.getHours() >= 4)) {
		hello.innerText = 'Доброе утро!';
	}
	if ((today.getHours() >= 12) && (today.getHours() < 18)) {
		hello.innerText = 'Добрый день!';
	}
	if ((today.getHours() >= 18) && (today.getHours() <= 23)) {
		hello.innerText = 'Добрый вечер!';
	}
	if ((today.getHours() >= 0) && (today.getHours() < 4)) {
		hello.innerText = 'Доброй ночи!';
	}
}
