function formCheck(form) {
if (form.message.value == "") {
alert("Please type your message!");
form.message.focus(); return false;}
form.save.disabled = true;
form.save.value="Please wait!";
}

function formCheck2(form) {
if (form.message.value == "") {
alert("Please type your message!");
form.message.focus(); return false;}
if (((form.email.value.indexOf("@")) < 1) ||
((form.email.value.indexOf(".")) < 1) ||
((form.email.value.length) < 4)) {
alert("You entered an incorrect e-mail address!");
form.email.focus(); return false;}
}


function submitform() {
	if (window.submitted) return false;
	window.submitted = true;
	return true;
}

function showimage() {
   document.images.icons.src="/smilies/"+document.form.icon.options[document.form.icon.selectedIndex].value+".gif";
}


function metatags(u,c) {
	var bb_obj = document.form.message;

	if(document.all && window.navigator.userAgent.toLowerCase().indexOf('opera')) {
		bb_obj.focus();
		selecttext = document.selection.createRange().text;

		if((selecttext && c) || bb_obj.isTextEdit) {
			if(bb_obj.isTextEdit && !selecttext) {
				var sel = document.selection;
				var nrn = sel.createRange();
				nrn.colapse;
				nrn.text = u;
				if(c) { nrn.text = c; }
			} else {
				document.selection.createRange().text = u+selecttext+c;
			}
		} else {
			bb_obj.value += u;
			if(c) { bb_obj.value += c; }
		}
	} else {
		if(!c) { c = ''; }
		bb_obj.value += u+c;
	}
	bb_obj.focus();
	selecttext = '';
}

function openmetatags(u) {
	var bbo_obj = opener.document.form.message;
	bbo_obj.value += u;
}

function ChangeColor(color) {
	if(color != '') { metatags("[color="+color+"]","[/color]"); document.form.color.value = ''; }
}

function tagdecrip (lookup) {
	document.getElementById('about').innerHTML = eval('func_'+lookup);
}

function goto(goto) {
   var fid=goto.options[goto.selectedIndex].value;
   document.location.href=fid;
}

function formCheck2(form) {
if (!form.flood[0].checked && !form.flood[1].checked) {
alert("Пожалуйста, укажите статус своего сообщения!");
form.flood[0].focus(); return false; } 
}

function show_link(thread,pid)
{
        var show_link_alert = "Please press Ctrl+Insert for addition of the link to the buffer of an exchange";
	temp = prompt( show_link_alert, home_forum + "/thread/" + thread + "----" + pid + ".html#" + pid );
	return false;
}

function open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
        toolbar_str = toolbar ? 'yes' : 'no';
        menubar_str = menubar ? 'yes' : 'no';
        statusbar_str = statusbar ? 'yes' : 'no';
        scrollbar_str = scrollbar ? 'yes' : 'no';
        resizable_str = resizable ? 'yes' : 'no';
        window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}
