function check_forum(){
	if (document.f_forum.gbsubj!=null) {
		if ( document.f_forum.gbsubj.value=='' ) { alert("Необходимо ввести тему сообщения!"); return false; }
		else { document.f_forum.gbsubj.value=check_field(document.f_forum.gbsubj.value,true); }
	}
	if (document.f_forum.gbmess.value=='') { alert("Необходимо ввести текст сообщения!"); return false; }
	document.f_forum.gbname.value=check_field(document.f_forum.gbname.value,true);
	document.f_forum.gbemail.value=check_field(document.f_forum.gbemail.value,true);
	document.f_forum.gbwww.value=check_field(document.f_forum.gbwww.value,true);
	document.f_forum.gbmess.value=check_field(document.f_forum.gbmess.value,false);
	return true;
}

function check_field(v,flag_aps){
	var ch,ret='';
	for(var i=0; i<v.length; i++) {
		ch=v.substring(i,i+1);
		if (ch=='<' || ch=='>') continue;
		if (flag_aps && (ch=='\'' || ch=='"') ) continue;
		ret+=ch;
	}
	return ret;
}

function forum_author(name,email,www){
	var str_tmp='';
	if (name=='' && email=='' && www=='') return;
	if (name!='') {
		str_tmp="<nobr>"+name+"<br>";
		if (email!='') str_tmp+=' <a href="mailto:'+email+'"><img src="/i/ic_email.gif" border=0 width=13 height=11 alt="E-mail автора"></a>';
		if (www!='') str_tmp+=' <a href="'+www+'" target=_balnk><img src="/i/ic_home.gif" border=0 width=13 height=11 alt="Home page"></a>';
		str_tmp+="</nobr>";
	}
	else {
		str_tmp='&nbsp;';
	}
	document.write(str_tmp);
}
