function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function menu_over(c)
	{
	 if((c!="i1")&&(c!="i2")&&(c!="i3"))document.all[c].style.backgroundColor="#EBF0F6";
	 c=c+"u";
	 document.all[c].style.backgroundColor="#FAEB00";
	}
function menu_out(c)
	{
	 document.all[c].style.backgroundColor="#ffffff";
	 c=c+"u";
	 document.all[c].style.backgroundColor="#e1e1e1";
	}	

function openwindow(title, path)
 {
var x,y;
var height=0; var width=0;
if (self.screen) {
width = screen.width
height = screen.height
}
else if (self.java) {
var jkit = java.awt.Toolkit.getDefaultToolkit();
var scrsize = jkit.getScreenSize();
width = scrsize.width;
height = scrsize.height;
}
width=(width/2)-150;
height=(height/2)-150;
//width=width-350;
//height=100;

NewWindow=window.open('','blank','scrollbars=0,status=0,toolbar=0,resizable,menubar=0,width=300,height=310,left=0,top=0');
NewWindow.document.write("<html><head><title>");
NewWindow.document.write(title);
NewWindow.document.write("</title><meta http-equiv='Content-Type' content='text/html; charset=windows-1251'>");
NewWindow.document.write("</head><body bgcolor='#FFFFFF' text='#000000' style='padding:0 0 0 0;margin: 0 0 0 0'><center>");
NewWindow.document.write("<table border=0>");
NewWindow.document.write("<tr><td><A HREF='JavaScript:this.close()'><center><img src='");
NewWindow.document.write(path);
NewWindow.document.write("' border=0></center></a>");
NewWindow.document.write("</tr></table></center><small></small></body></html>");
NewWindow.document.close();
NewWindow.moveTo(width,height);
NewWindow.focus();
}



bbcode = new Array();
bbtags = new Array('<b>','</b>','<i>','</i>','<p>','</p>','<a href=','</a>','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]');

function  sel_news()
{
document.all['news'].select();
}
function bbstyle(bbnumber,a)
	{
    theSelection = false;
    theSelection = document.selection.createRange().text;
    if (theSelection)
    	{
        //новый блок 1_1
        if(bbnumber==6)
        	{
            document.selection.createRange().text = bbtags[bbnumber]+"'"+a+"'>" + theSelection + bbtags[bbnumber+1];
    	theSelection = '';
        document.all["news"].focus();
            }
        else
        	{
        //новый блок  1_2
        document.selection.createRange().text = bbtags[bbnumber] + theSelection + bbtags[bbnumber+1];
    	theSelection = '';
        document.all["news"].focus();
        //новый блок  2_1
        	}
        //новый блок  2_2


        }
 	}
function showSelected(a,l) {
var selNum = a.s.selectedIndex;
var selText = a.s.options[selNum].value;
a.source.value=selText;
a.link.value=l[selNum];
}
