function show(url,w,h){
	window.open(url,"","width="+w+",height="+h);
}

function MM_jumpMenu(targ,selObj,restore){
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) 
		selObj.selectedIndex=0;
}

function rnd(){return Math.round(Math.random()*2000000000);}

function rand(f,t){
			return Math.floor(Math.random()*Math.floor(t-f+1)+f);
}

function rc_formCheck(f,p)	{
	if (f.p.user.value=="")	 {
		alert('Не указано имя автора');
		f.p.user.focus();
		return false;
	}
	if (f.p.title.value=="") {
		if ( p == "newmessage")	{
			alert("Пожалуйста, выберите сообщение и нажмите \"Ответить\", или заполните поле \"Тема\"");					
		}	else	{
			alert('Не указана тема сообщения'); 
		}
		f.p.title.focus();
		return false;
	}			
	return true;
}		

function submit_it() {
  if(document.forms.newmessage.user.value=="")	{
		alert("Не указано имя автора");
		document.forms.newmessage.user.focus();  
		return false;
  }
  if(document.forms.newmessage.title.value=="")	{
		alert("Пожалуйста, выберите сообщение и нажмите \"Ответить\", или заполните поле \"Тема\"");
		document.forms.newmessage.title.focus();
		return false;
  }
return true;
}

function rc_formSubmit(f)	{
	if (b=rc_formCheck(f))
		f.submit();
	return b;
}

function rc_reply(id,title,fname)	{
	var f=document.forms[fname];
	if(title.substr(0,3).search(/^re:$/i)==-1)title='Re: '+title;
	f.title.value=title;
	f.messageid.value=id;
}

function rc_open(url,w,h,r,s)	{
	arg="width="+w+",height="+h+",location=0,menubar=0,resizable="+r+",scrollbars="+s+",status=0,titlebar=0,toolbar=0,hotkeys=0";
	window.open(url,'',args);
}

function authchange()	{
	var l=document.links["authlink1"],m=document.links["authlink2"],n=document.links["rc_authlink"];
	if(l)l.href=l.href.replace(/_c=\d+/, "_c="+rand(100000000,999999999));
	if(m)m.href=m.href.replace(/_c=\d+/, "_c="+rand(100000000,999999999));
	if(n)n.href=n.href.replace(/_c=\d+/, "_c="+rand(100000000,999999999));
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
