function shad(c, w)
{if (w==1)
 {c.style.filter="light"; 
   if (c.filters.light)
       {c.filters.light.addAmbient(200,100,100,250);}

  }
 else
 {c.style.filter=0}
}

function innew(doc, wid, hei, doctitle)
{
	var newindow, nleft, ntop;
	nleft=(screen.availWidth - wid)/2;
	ntop=(screen.availHeight - hei)/2;
    newindow=window.open("","","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,left="+nleft+",top="+ntop+",width="+wid+",height="+hei+"");
	if (newindow!=null && newindow.opener == null) newindow.opener=window;
	newindow.document.open();
	newindow.document.writeln ("<html><head><title>"+doctitle+"</title></head><body topmargin='0' leftmargin='0'  bgcolor='#000000'><img src='"+doc+"'width='"+wid+"' height='"+hei+"' align='top'> </body></html>");
	newindow.document.close();

	}

function showstatus(cont)
{
    window.status=cont;
}	

function setbgimage()
{
document.body.background="bgr.wmf";
}

function dopop()
{
var mypop;
mypop = window.createpopup();
alert ('pop');
var mypopbody = document.mypop.body;
mypopupbody.innerhtml = 'Text!';
mypop.show(200, 100, 200, 50, document.body);
}
	
<!--    Dalshe idut chuzhie functions          -->

<!-- functions dlya obrabotki vvodimogo texta  -->
function doalert(msg){
alert (msg);
}

function normmodestat(){
	if (document.f.kmode[0].checked) {
		return true;
	}
	else {
		return false;
	}
}



function dotag(thetag){
	var tagOpen = eval(thetag + "_open");

	//if ( normmodestat() ) {
	if (false){
		inserttext = prompt(prompt_start + "\n<" + thetag + ">xxx</" + thetag + ">");
		
		if ( (inserttext != null) && (inserttext != "") ) {
			doInsert("<" + thetag + ">" + inserttext + "</" + thetag + "> ", "", false);
		}
	}
	else {
		if (tagOpen == 0) {
			if(thetag == "PHP") {
					var openphp = '<?php ';
					var closephp = ' ?>';
			} else {
				var openphp = '';
				var closephp = '';
			}
					
			if(doInsert("<" + thetag + ">", "</" + thetag + ">", true)){
				eval(thetag + "_open = 1");
				//eval("document.f." + thetag + ".value += '*'");
				eval("document.f." + thetag + ".value = '/' + document.f." + thetag + ".value");
				pushstack(ktags, thetag);
				khelp('close');
			}
		}
		else {
			lastindex = 0;
			
			for (i = 0 ; i < ktags.length; i++ ) {
				if ( ktags[i] == thetag ) {
					lastindex = i;
				}
			}
			
			
			
			while (ktags[lastindex]) {
				if(thetag == "PHP") {
					var closephp = ' ?>';
			} else {
				var closephp = '';
			}
				tagRemove = popstack(ktags);
				doInsert("</" + tagRemove + ">", "", false)
				eval("document.f." + tagRemove + ".value = ' " + tagRemove + " '");
				eval(tagRemove + "_open = 0");
			}
		}
	}
}

function dourl()
{
    document.f.otziv.focus();
    var sel = document.selection;
    var rng = sel.createRange();
	if (rng.text == "") {var promptURL = "http://";} else {
	          var promptURL = rng.text.substr(0,3);
	          if (promptURL == "www") {promptURL = "http://" + rng.text;} else {promptURL = rng.text;}
	                                            }	
    var FoundErrors = '';
    var enterURL   = prompt("Введите адрес:", promptURL);
    var enterTEXT = prompt("Введите название сайта:", "Мой Сайт");
	var enterTITLE = prompt("Введите описание сайта (не обязательно):", "");

    if (!enterURL) {
        FoundErrors += " " + "Вы не ввели URL.";
    }
    if (!enterTEXT) {
        FoundErrors += " " + "Вы не ввели название сайта.";
    }

    if (FoundErrors) {
        alert(""+FoundErrors);
        return;
    }

	doInsert("<a href='"+enterURL+"' title='"+enterTITLE+"'>"+enterTEXT+"</a>", "", false);
}


function doimage(){
    document.f.otziv.focus();
    var sel = document.selection;
    var rng = sel.createRange();
	if (rng.text == "") {var promptURL = "http://";} else {
	          var promptURL = rng.text.substr(0,3);
	          if (promptURL == "www") {promptURL = "http://" + rng.text;} else {promptURL = rng.text;}
	                                            }
    var FoundErrors = '';
	var text_enter_image='Пожалуйста, введите полный URL до изображения';
	var enterURL   = prompt(text_enter_image, promptURL);

    if (!enterURL) {
        FoundErrors += " " + "Вы не ввели URL.";
    }

    if (FoundErrors) {
        alert(""+FoundErrors);
        return;
    }

	doInsert("<img src='"+enterURL+"'>", "", false);
}

function doemail(){
    document.f.otziv.focus();
    var sel = document.selection;
    var rng = sel.createRange();
    var promptURL = rng.text;	                                            
    var emailAddress = prompt("Введите адрес электронной почты:", promptURL);

    if (!emailAddress) { 
		alert("Вы не ввели адрес."); 
		return; 
	}

	doInsert("<a href='mailto:"+emailAddress+"'>"+emailAddress+"</a>", "", false);
}


function doInsert(ktag, kctag, once){
	var isClose = false;
	var obj_ta = document.f.otziv;

	if ( (myVersion >= 4) && is_ie && is_win) {
		if(obj_ta.isTextEdit){ 
			obj_ta.focus();
			var sel = document.selection;
			var rng = sel.createRange();
			
			if((sel.type == "Text" || sel.type == "None") && rng != null){
				if(kctag != "" && rng.text.length > 0)
					ktag += rng.text + kctag;
				else if(once)
					isClose = true;
	
				rng.text = ktag;
				rng.collapse();
			}
		}
		else{
			if(once)
				isClose = true;
	
			obj_ta.value += ktag;
		}
	}
	else
	{
		if(once)
			isClose = true;

		obj_ta.value += ktag;
	}
	obj_ta.focus();
	return isClose;
}	

	
	var B_open = 0;
	var I_open = 0;
	var U_open = 0;
	var QUOTE_open = 0;
	var CODE_open = 0;
	var PHP_open = 0;

var ktags   = new Array();
var myAgent   = navigator.userAgent.toLowerCase();
var myVersion = parseInt(navigator.appVersion);

var is_ie   = ((myAgent.indexOf("msie") != -1)  && (myAgent.indexOf("opera") == -1));
var is_nav  = ((myAgent.indexOf('mozilla')!=-1) && (myAgent.indexOf('spoofer')==-1)
                && (myAgent.indexOf('compatible') == -1) && (myAgent.indexOf('opera')==-1)
                && (myAgent.indexOf('webtv') ==-1)       && (myAgent.indexOf('hotjava')==-1));

var is_win   =  ((myAgent.indexOf("win")!=-1) || (myAgent.indexOf("16bit")!=-1));
var is_mac    = (myAgent.indexOf("mac")!=-1);



function stacksize(thearray){
	for (i = 0 ; i < thearray.length; i++ ) {
		if ( (thearray[i] == "") || (thearray[i] == null) || (thearray == 'undefined') ) {
			return i;
		}
	}
	
	return thearray.length;
}



function pushstack(thearray, newval){
	arraysize = stacksize(thearray);
	thearray[arraysize] = newval;
}



function popstack(thearray){
	arraysize = stacksize(thearray);
	theval = thearray[arraysize - 1];
	delete thearray[arraysize - 1];
	return theval;
}

<!--      prochie functions          -->
<!--        shleifffff               -->

 function createContainer(N,Xp,Yp,W,H,At,HT,Op,St)
  {
    with (document)
    {
      write((!B) ? "<layer id='"+N+"' left="+Xp+" top="+Yp+" width="+W+" height="+H : "<div id='"+N+"'"+" style='position:absolute;left:"+Xp+"; top:"+Yp+"; width:"+W+"; height:"+H+"; z-index:-1");
      if(St)
      {
        if (C)
          write(" style='");
        write(St+";' ")
      }
      else
        write((B)?"'":"");
      write((At)? At+">" : ">");
      write((HT) ? HT : "");
      if (!Op)
        closeContainer(N)
    }
  }
  function closeContainer()
  {
    document.write((B)?"</div>":"</layer>")
  }
  function getXpos(N)
  {
    return (B) ? parseInt(B[N].style.left) : C[N].left
  }
  function getYpos(N)
  {
    return (B) ? parseInt(B[N].style.top) : C[N].top
  }
  function moveContainer(N,DX,DY)
  {
    c=(B) ? B[N].style :C[N];c.left=DX;c.top=DY
  }
  function cycle()
  {
    if (document.all)
    {
      iefix1=document.body.scrollLeft;
      iefix2=document.body.scrollTop;
    }
    for (i=0;i<(nos-1);i++)
    {
      moveContainer("CUR"+i,getXpos("CUR"+(i+1)),getYpos("CUR"+(i+1)))
    }
  }

  function newPos(e)
  {
    moveContainer("CUR"+(nos-1),(B)?event.clientX+iefix1:e.pageX+2,(B)?event.clientY+iefix2:e.pageY+2)
  }

function doshleif()
{     if (navigator.userAgent.indexOf('MSIE')==-1){return;}
  B=document.all;
  C=document.layers;
  T1=new Array("t1.gif",10,8,"t2.gif",12,10,"t3.gif",14,12,"t4.gif",16,14,"t5.gif",18,16,"t6.gif",20,18)
  nos=parseInt(T1.length/3)
  rate=50
  iefix1=0;
  iefix2=0;
  for (i=0;i<nos;i++)
  {
    createContainer("CUR"+i,i*10,i*10,i*3+1,i*3+2,"","<img src='"+T1[i*3]+"' width="+T1[(i*3+1)]+" height="+T1[(i*3+2)]+" border=0>")
  }
  if(document.layers)
    document.captureEvents(Event.MOUSEMOVE)
  else
  if(B)
    document.body.onscroll=newPos
  document.onmousemove=newPos
  setInterval("cycle()",rate)}