function WRU(a,b,c,d,e,t){
document.write("<a rel=\"nofollow\" ");
if(t.length>1) document.write(" title=\""+t+"\"");
if(e==1) document.write(" target=\"_blank\"");
if(d.length>0) document.write("class=\""+d+"\" ");
document.write("href=\""+a+b+c+"\">");
}

function tdivcom() {
	var ds=document.getElementById('divcom');
	var pcom=document.getElementById('pcom');
	var scom=document.getElementById('scom');
	if(ds.style.display!="inline") {
		ds.style.display="inline";
		pcom.focus();
		scom.title="Закрыть комментирование";
		return false;
	} else {
		if(pcom.value.length<3) {
			ds.style.display="none";
			scom.title="Написать новый комментарий";
			return false;
		} else {
//			alert(pcom.value);
			scom.submit();
		}
	}
	return false;
}

function changelakelist(areaid) {
	var ds=document.getElementById(areaid);
	var dt=ds.style.display;
//	alert("["+dt+"]");
	if(ds.style.display!="block" && ds.style.display!="") {
		ds.style.display="block";
	} else {
		ds.style.display="none";
	}
}


function comimg(){
	var pcom=document.getElementById('pcom');
	var scom=document.getElementById('scom');
	if(pcom.value.length<3){
		scom.title="Закрыть комментирование.";
		scom.src="/imgs/MM/leavecomment.png";
	} else {
		if(scom.src.match("leavecomment.png")){
			scom.title="Отправить мой комментарий";
			scom.src="/imgs/MM/leavecomment2.png";
		}
	}
}

function add_text(fn,msg){
	var as=document.getElementById(fn).value;
	var spc=as.charAt(as.length-1);
	if(spc==" " || spc=="") {
		spc="";
	} else {
//		alert(spc);
		spc=" ";
//		alert(as.charAt(as.length-1));
	}
	
	document.getElementById(fn).value=as+spc+msg;
	document.getElementById(fn).focus();
}

