// *** Верхнее обрамление меню ***
 
 function loadpers() 
    {
	document.getElementById('el4').style.backgroundColor='#404040';
	document.getElementById('el4').style.color='#FFFFFF';
	showtable('4');
    } 

    function showtable (tblname)
    {
	hidesel(tblname);
	hidemenu(0);
	document.getElementById('menu'+tblname).style.visibility = 'visible';
	document.getElementById('menu'+tblname).style.width = '';
 	document.getElementById('menu'+tblname).style.overflow = 'visible';
    }

    function hidesel (tblname)
    {
	for (var i=1;i<=5;i++) 
	{
	if (i!=tblname) {document.getElementById('el'+i).style.backgroundColor='';document.getElementById('el'+i).style.color='';}
	}	
    }

    function hidemenu (time) 
    {
	for (var i=1;i<=5;i++) 
	{
	  document.getElementById('menu'+i).style.visibility = 'hidden';
	  document.getElementById('menu'+i).style.width = '1px';
	  document.getElementById('menu'+i).style.overflow = 'hidden';
	}	
    }
// *** Разное ***
    function imover(im) {im.filters.Glow.Enabled=true;}
    function imout(im) {im.filters.Glow.Enabled=false;}
    function Down() {top.CtrlPress = window.event.ctrlKey}
    document.onmousedown = Down;

    function solo(n)
    {
      if(is_accessible)
	window.location.href='about:location='+n;
    }

    function fastshow(content)
    {
      var el = document.getElementById("mmoves");
      var o = window.event.srcElement;
      if (content!='' && el.style.visibility != "visible") {el.innerHTML = '<small>'+content+'</small>';}
      var x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft + 3;
      var y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop+5;
      el.style.left = x + "px";
      el.style.top  = y + "px";
      if (el.style.visibility != "visible") {el.style.visibility = "visible";}
    }

    function fastshow2 (content)
    {
	var el = document.getElementById("mmoves");
	var o = window.event.srcElement;
	if (content!='' && el.style.visibility != "visible") {el.innerHTML = '<small>'+content+'</small>';}
	var x = window.event.clientX + document.documentElement.scrollLeft + document.body.scrollLeft - el.offsetWidth + 5;
	var y = window.event.clientY + document.documentElement.scrollTop + document.body.scrollTop+20;
	el.style.left = x + "px";
	el.style.top  = y + "px";
	if (el.style.visibility != "visible"){ el.style.visibility = "visible";}
    }
    
    function hideshow(){document.getElementById("mmoves").style.visibility = 'hidden';}

// *** Смена хитпоинтов ***
    var delay = 1;            // Каждые 18сек. увеличение HP на 1%
    var redHP = 0.33;	      // меньше 30% красный цвет
    var yellowHP = 0.66;      // меньше 60% желтый цвет, иначе зеленый
    var TimerOn = -1;	      // id таймера
    var tkHP, maxHP;
    var speed=100;

    function setHP(value, max, newspeed)
    {
	tkHP=value; maxHP=max;
	if (TimerOn>=0) { clearTimeout(TimerOn); TimerOn=-1; }
	speed=newspeed;
	setHPlocal();
    }

    function setHPlocal()
    {
	if (tkHP>maxHP) { tkHP=maxHP; }
	var le=Math.round(tkHP)+"/"+maxHP;
	le=240 - (le.length + 2)*7;
	var sz1 = Math.round(((le-1)/maxHP)*tkHP+1);
	var sz2 = le - sz1;
	if (document.all("HP"))
        {
	  document.HP1.width=sz1;
	  document.HP2.width=sz2;
	  if (tkHP/maxHP < redHP) { document.HP1.src='#gpath#/bk_life_red.gif'; }
	  else
        {
	    if (tkHP/maxHP < yellowHP) { document.HP1.src='#gpath#/bk_life_yellow.gif'; }
	    else { document.HP1.src='#gpath#/bk_life_green.gif'; }
        }
	  var s = document.all("HP").innerHTML;
	  document.all("HP").innerHTML = Math.round(tkHP)+"/"+maxHP;
	}
	tkHP = (tkHP+(maxHP/100.0)*speed/100.0);
	if(tkHP>=maxHP && TimerOn>=0) { TimerOn=-1; tkHP=maxHP; setHPlocal(); }
        else { TimerOn=setTimeout('setHPlocal()', delay*1000); }
    }

// *** Смена манны ***
    var Mdelay = 1;
    var MTimerOn = -1;	// id таймера
    var tkMana, maxMana;
    var mspeed=100;

    function setMana(value, max, newspeed)
    {
	tkMana=value; maxMana=max;
	if (MTimerOn>=0) { clearTimeout(MTimerOn); MTimerOn=-1; }
	if (newspeed < 1) newspeed=1;
	mspeed=newspeed;
	setManalocal();
    }

    function setManalocal()
    {
	if (maxMana==0) return(0);
	if (tkMana>maxMana) { tkMana=maxMana; }
	var le=Math.round(tkMana)+"/"+maxMana;
	le=240 - (le.length + 2)*7;
	var sz1 = Math.round(((le-1)/maxMana)*tkMana+1);
	var sz2 = le - sz1;
	if (document.all("Mana"))
      {
	  document.Mana1.width=sz1;
	  document.Mana2.width=sz2;
	  document.Mana1.src='#gpath#/bk_life_beg_33.gif';
	  var s = document.all("Mana").innerHTML;
	  document.all("Mana").innerHTML = s.substring(0, s.lastIndexOf(':')+1) + Math.round(tkMana)+"/"+maxMana;
	}
	tkMana = (tkMana+(maxMana/100.0)*mspeed/100.0);
	if(tkMana>=maxMana && MTimerOn>=0) { MTimerOn=-1; tkMana=maxMana; setManalocal(); }
        else { MTimerOn=setTimeout('setManalocal()', Mdelay*1000); }
    }

// *** Инфо игрока *** 
    function getalign(al)
    {
      var n=parseFloat(al);
      if (n>=1 && n<2) return("Белое братство");
      if (n>=2 && n<3) return("Хаос");
      if (n>=3 && n<4) return("Темное братство");
      if (n>=7 && n<8) return("Нейтральное братство");
      if (n>=50 && n<51) return("Алхимики");
      return("");
    }

    function drwfl(name, id, level, align, klan)
    {
      var s="";


      if (align!=0) s+="<IMG SRC='#gpath#/align"+align+".gif' WIDTH=12 HEIGHT=15 ALT=\""+getalign(align)+"\"></A>";
      if (klan)       s+="<IMG SRC='#gpath#/"+klan+".gif' WIDTH=24 HEIGHT=15 ALT="+klan+"></A>";
                      s+="<B>"+name+"</B>";
      if (level!=-1)  s+=" ["+level+"]";
      if (id!=-1)     s+="<A HREF='about:bot="+id+"'><IMG SRC='#gpath#/inf.gif' WIDTH=12 HEIGHT=11 ALT='Инф. о "+name+"'></A>";
      document.write(s);
    }

// *** Инвентарь ***
    function drop(name, script, txt)
    {
	dialogconfirm('Выбросить предмет?', script, '<TABLE width=100%><TD><IMG src="#gpath#/'+name+'.gif"></TD><TD>Предмет <NOBR><B>\''+txt+'\'</B></NOBR> будет утерян, вы уверены ?</TABLE>'+
	'<input type=checkbox name="dropall" value="'+txt+'"><SMALL> Все предметы этого вида</SMALL>'+
	'<INPUT type=hidden name=drop value="'+name+'"><INPUT type=hidden name=n value=""><INPUT type=hidden name=sd4 value="1134227786">');
    }
// *** Комплект ***
    function saveCompl()
    {
      document.location.href='about:saveCompl='+savekmp.value;
      closehint3();
    }

    function kmp(str)
    {
	document.all("hint4").innerHTML = '<table width=400 cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>Запомнить комплект одежды</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();"><BIG><B>x</td></tr><tr><td colspan=2>'+
	'<table width=100% cellspacing=0 cellpadding=5 bgcolor=FFF6DD><tr><td>Запомнить надетый комплект одежды, для быстрого переодевания. Подробнее об этой функции читайте в разделе <A HREF="/encicl/help/invent.html" target="help">Подсказка</A>.<BR>'+
	'Введите название комплекта: <INPUT TYPE=text NAME=savekmp VALUE="'+str+'" maxlength=30></TD></TR><TR><TD align=center><INPUT TYPE="button" value="Запомнить" onclick="javascript:saveCompl()"></TD></TR></TABLE></td></tr></table>';
	document.all("hint4").style.visibility = "visible";
	document.all("hint4").style.left = 100;
	document.all("hint4").style.top = 100;
	document.all("savekmp").focus();
    }

// *** Заголовок, название скрипта, имя поля с логином ***
  function attack()
  {
    document.location.href='about:attack='+attack.value;
    closehint3();
  }

 function attack2()
  {
    document.location.href='about:attackb='+attack.value;
    closehint3();
  }


  function dlgAttack(name)
  {
    var s;
    s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>'+
      'Укажите логин персонажа:<small><BR>(щелкните по логину в чате)</TD></TR><TR><TD width=50% align=right style="padding-left:5"><INPUT style="width: 100%" TYPE="text" NAME=attack VALUE="'+name+'"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="javascript:attack()"></TD></TR></TABLE>';

    s = crtmagic(0, 'Напасть на', s);

    document.all("hint4").innerHTML = s;
    document.all("hint4").style.visibility = "visible";
    document.all("hint4").style.left = 100;
    document.all("hint4").style.top = document.body.scrollTop+50;
    Hint3Name = name;

    if(name=='') document.location.href='about:setAttack';
  }


function dlgAttack2(name)
  {
    var s;
    s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>'+
      'Укажите логин персонажа:<small><BR>(щелкните по логину в чате)</TD></TR><TR><TD width=50% align=right style="padding-left:5"><INPUT style="width: 100%" TYPE="text" NAME=attack VALUE="'+name+'"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="javascript:attack2()"></TD></TR></TABLE>';

    s = crtmagic(0, 'Напасть на', s);

    document.all("hint4").innerHTML = s;
    document.all("hint4").style.visibility = "visible";
    document.all("hint4").style.left = 100;
    document.all("hint4").style.top = document.body.scrollTop+50;
    Hint3Name = name;

    if(name=='') document.location.href='about:setAttack';
  }

  function findlogin(title, script, name, defaultlogin, mtype)
  {
    var s;
    s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>'+
      'Укажите логин персонажа:<small><BR>(можно щелкнуть по логину в чате)</TD></TR><TR><TD width=50% align=right style="padding-left:5"><INPUT style="width: 100%" TYPE="text" NAME="'+name+'" value="'+defaultlogin+'"></TD><TD width=50%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="location.href=\''+script+'\'"></TD></TR></TABLE>';
    s = crtmagic(mtype, title, s);

    document.all("hint4").innerHTML = s;
    document.all("hint4").style.visibility = "visible";
    document.all("hint4").style.left = 100;
    document.all("hint4").style.top = document.body.scrollTop+50;
    document.all(name).focus();
    Hint3Name = name;
  }
// *** Гравировка ***
  function grav(id)
  {
    document.location.href='about:gravItem='+document.all("param").value+';'+id+';';
    closehint3();
  }

// *** Подгонка ***
  var sItem=0;
  function setStrengthItem(id)
  {
    sItem=id;
  }

  function strengthItem(id)
  {
    document.location.href='about:strengthItem='+id+';'+sItem+';';
  }

// *** Магия ***
  function UseMagick(title, script, name, extparam, n, extparam2, mtype)
  {
    if ((extparam!=null)&&(extparam!=''))
    {
      var t1='text',t2='text';

      if (extparam.substr(0,1) == "!")
      {
        t1='password';
        extparam=extparam.substr(1,extparam.length);
      }

      var s = '<table border=0 width=100% cellspacing="1" cellpadding="0"><TR><input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'"><td colspan=2 align=left><NOBR><SMALL>'+
      extparam + ':</NOBR></TD></TR><TR><TD width=100% align=left style="padding-left:5"><INPUT tabindex=1 style="width: 100%" TYPE="'+t1+'" id="param" NAME="param" value=""></TD><TD width=10%><INPUT type=image SRC="#IMGSRC#" WIDTH="27" HEIGHT="20" BORDER=0 ALT="" onclick="location.href=\''+script+'\'"></TD></TR>';
      if (extparam2 != null && extparam2 != '') 
      {
        if (extparam2.substr(0,1) == "!")
        {
          t2='password';
          extparam2=extparam2.substr(1,extparam2.length);
        }
        s = s + '<TR><td colspan=2><NOBR><SMALL>'+extparam2+':</NOBR><TR style="padding-left:5"><TD><INPUT tabindex=2 TYPE="'+t2+'" NAME="param2" style="width: 50%"></TD><TD></TR>';
      }
      s += '</TABLE>';
      s = crtmagic(mtype, title, s);
      document.all("hint4").innerHTML = s;
      document.all("hint4").style.visibility = "visible";
      document.all("hint4").style.left = 100;
      document.all("hint4").style.top = document.body.scrollTop+50;
      document.all("param").focus();
      Hint3Name = 'param';
    } 
    else
    {
      dialogconfirm('Подтверждение', script, '<TABLE width=100%><TD><IMG src="#gpath#/'+name+'.gif"></TD><TD>Использовать сейчас?</TABLE>'+
                    '<input type=hidden name="use" value="'+name+'"><input type=hidden name="n" value="'+n+'">', mtype);
    }
  }

  function crtmagic(mtype, title, body, subm)
  {
    //name, XYX, X1-X2-Y2, pad.LRU
    mtype=foundmagictype(mtype);

    var names=new Array(
    'neitral',17, 6, 14, 17, 14, 7,0,0, 3,
    'fire', 57, 30, 33, 20, 21, 14, 11, 12, 0,
    'water', 57, 30, 33, 20, 21, 14, 11, 12, 0,
    'air', 57, 30, 33, 20, 21, 14, 11, 12, 0,
    'earth', 57,30, 33, 20, 21, 14, 11, 12, 0,
    'white', 51, 25, 46, 44, 44, 10, 5, 5, 0,
    'gray', 51, 25, 46, 44, 44, 10, 5, 5, 0,
    'black', 51, 25, 46, 44, 44, 10, 5, 5, 0);
    var colors=new Array('B1A993','DDD5BF', 'ACA396','D3CEC8', '96B0C6', 'BDCDDB', 'AEC0C9', 'CFE1EA', 'AAA291', 'D5CDBC', 'BCBBB6', 'EFEEE9', '969592', 'DADADA', '72726B', 'A6A6A0');

    while (body.indexOf('#IMGSRC#')>=0) body = body.replace('#IMGSRC#', '#gpath#/'+names[mtype*10]+'_30.gif');
    var s='<table width="270" border="0" align="center" cellpadding="0" cellspacing="0">'+
	'<tr>'+
	'<td width="100%">'+
	'<table width="100%"  border="0" cellspacing="0" cellpadding="0">'+
	'<tr><td>'+
            '<table width="100%" border="0" cellpadding="0" cellspacing="0">'+
            '<tr>'+
            '<td width="'+names[mtype*10+1]+'" align="left"><img src="http://img.combats.ru/i/misc/dmagic/b'+names[mtype*10]+'_03.gif" width="'+names[mtype*10+1]+'" height="'+names[mtype*10+2]+'"></td>'+
            '<td width="100%" align="right" background="http://img.combats.ru/i/misc/dmagic/b'+names[mtype*10]+'_05.gif"></td>'+
            '<td width="'+names[mtype*10+3]+'" align="right"><img src="http://img.combats.ru/i/misc/dmagic/b'+names[mtype*10]+'_07.gif" width="'+names[mtype*10+3]+'" height="'+names[mtype*10+2]+'"></td>'+
            '</tr>'+
            '</table></td>'+
        '</tr>'+
        '<tr><td>'+
            '<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
            '<tr>'+
                 (names[mtype*10+7]?'<td width="'+names[mtype*10+7]+'"><SPAN style="width:'+names[mtype*10+7]+'">&nbsp;</SPAN></td>':'')+
                 '<td width="5" background="http://img.combats.ru/i/misc/dmagic/b'+names[mtype*10]+'_17.gif">&nbsp;</td>'+
                 '<td width="100%">'+
                 '<table width="100%" border="0" cellspacing="0" cellpadding="0">'+
                 '<tr><td bgcolor="#'+colors[mtype*2]+'"'+(names[mtype*10+9]?' style="padding-top: '+names[mtype*10+9]+'"':'')+' >'+
                 '<table border=0 width=100% cellspacing="0" cellpadding="0"><td style="padding-left: 20" align=center><B>'+title+
                 '</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint3();" style=\'filter:Gray()\' onmouseover="this.filters.Gray.Enabled=false" onmouseout="this.filters.Gray.Enabled=true"><IMG src="#gpath#/clear.gif" width=13 height=13>&nbsp;</td></table>'+
                 '</td></tr>'+
                 '<tr>'+
                      '<td align="center" bgcolor="#'+colors[mtype*2+1]+'">'+body+
                 '</tr>'+
                 '</table></td>'+
                 '<td width="5" background="http://img.combats.ru/i/misc/dmagic/b'+names[mtype*10]+'_19.gif">&nbsp;</td>'+
                 (names[mtype*10+8]?'<td width="'+names[mtype*10+8]+'"><SPAN style="width:'+names[mtype*10+8]+'">&nbsp;</SPAN></td></td>':'')+
                 '</tr>'+
            '</table></td>'+
        '</tr>'+
        '<tr><td>'+
            '<table width="100%"  border="0" cellpadding="0" cellspacing="0">'+
            '<tr>'+
                 '<td width="'+names[mtype*10+4]+'" align="left"><img src="http://img.combats.ru/i/misc/dmagic/b'+names[mtype*10]+'_27.gif" width="'+names[mtype*10+4]+'" height="'+names[mtype*10+6]+'"></td>'+
                 '<td width="100%" align="right" background="http://img.combats.ru/i/misc/dmagic/b'+names[mtype*10]+'_29.gif"></td>'+
                 '<td width="'+names[mtype*10+5]+'" align="right"><img src="http://img.combats.ru/i/misc/dmagic/b'+names[mtype*10]+'_31.gif" width="'+names[mtype*10+5]+'" height="'+names[mtype*10+6]+'"></td>'+
            '</tr>'+
            '</table></td>'+
        '</tr>'+
        '</table></td>'+
     '</tr>'+
     '</table>';
     return s;
  }

  function foundmagictype (mtypes)
  {
    if (mtypes) 
    {
      mtypes=mtypes+"";
      if (mtypes.indexOf(',') == -1) return parseInt(mtypes);
      var s=mtypes.split(',');
      var found=0;
      var doubl=0;
      var maxfound=0;

      for (i=0; i < s.length; i++)
      {
        var k=parseInt(s[i]);
        if (k > maxfound)
        {
          found=i + 1;
          maxfound=k;
          doubl=0;
        } 
        else{ if (k == maxfound) {doubl=1;}}
      }
      if (doubl) {return 0};

      return found;
    }
    return 0;
  }

//*** Диалог ***
  function dialogconfirm(title, script, text, mtype)
  {
    var s;

    s='<table border=0 width=100% cellspacing="0" cellpadding="2"><tr><td colspan=2>'+
      text+'</TD></TR><TR><TD width=50% align=left><INPUT TYPE="button" name="tmpname423" value="Да" style="width:70%" onclick="location.href=\''+script+'\'"></TD><TD width=50% align=right><INPUT type=button style="width:70%" value="Нет" onclick="closehint3();"></TD></TR></TABLE>';

    s = crtmagic(mtype, title, s);
    document.all("hint4").innerHTML = s;
    document.all("hint4").style.visibility = "visible";
    document.all("hint4").style.left = 100;
    document.all("hint4").style.top = document.body.scrollTop+50;
    document.all("tmpname423").focus();
    Hint3Name = name;
  }

//*** Магазин ***
  function AddCount(name, txt)
  {
    var s;

    s = '<table width=100% cellspacing=1 cellpadding=0 bgcolor=CCC3AA><tr><td align=center><B>Купить неск. штук</td><td width=20 align=right valign=top style="cursor: hand" onclick="closehint2();"><BIG><B>x</TD></tr><tr><td colspan=2>'+
      '<table width=100% cellspacing=0 cellpadding=0 bgcolor=FFF6DD><tr><INPUT TYPE=hidden name=set value="'+name+'"><td colspan=2 align=center><B><I>'+txt+'</td></tr><tr><td width=80% align=right>'+
      'Количество (шт.) <INPUT TYPE=text NAME=count size=4 onchange="checkVal ('+name+', count.value)"></td><td width=20%>&nbsp;<INPUT name=subm TYPE=button value=" »» ">'+
      '</TD></TR></TABLE></td></tr></table>';
    document.all("hint3").innerHTML = s;
    document.all("hint3").style.visibility = "visible";
    document.all("hint3").style.left = event.x+document.body.scrollLeft-20;
    document.all("hint3").style.top  = event.y+document.body.scrollTop+5;
    document.all("count").focus();
  }

  function checkVal (name, val)
  {
    str = "";
    if (val.match(/^[0-9]+$/) && val/1 > 0) str="document.location='about:buy="+name+";"+val+";'";
    else                                    str = ""; 
    document.all("subm").onclick=function() {eval(str)}; 
  }

  function subm(event){if((event.keyCode==13)||(event.keyCode==10)) { document.F1.unlock.click();}}

  function closehint3()
  {
    document.all("hint4").style.visibility="hidden";
    Hint3Name='';
    document.location.href='about:cancelScript';
  }
  function closehint2()
  {
    document.all("hint3").style.visibility="hidden";
    Hint3Name='';
    document.location.href='about:cancelScript';
  }


var no = 25; // snow number
var speed = 20; // smaller number moves the snow faster
var sp_rel = 1.4; //speed relevation
var snowflake1 = "#gpath#/snow1.gif";
var snowflake2 = "#gpath#/snow2.gif";
 
var i, doc_width, doc_height;

dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();

Array.prototype.exists = function(el)
{
    for(var i=0;i<this.length;i++)
	if(this[i]==el)
	    return true;
    return false;	
}

var rooms = ['1.100', '1.107', '1.111', '1.120'];

function SetVariable(c) {
	dx[c] = 0;                        // set coordinate variables
	am[c] = Math.random()*15;         // set amplitude variables
	xp[c] = Math.random()*(doc_width-35) + 0 + am[c];  // set position variables
	yp[c] = 0;
	stx[c] = 0.02 + Math.random()/10; // set step variables
	sty[c] = 0.7 + Math.random();     // set step variables
}

function DrawWeather(room) {
  


if (room==0)
{
return 0;
}

    doc_width = 500;
    doc_height = 240;
    
	var div = '';
	for (i = 0; i < no; ++ i) {  
		SetVariable(i);
		div += "<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: 30" + i +"; VISIBILITY: visible; TOP: " + 0 + "px; LEFT: " + 0 + "px;\"><img id=\"im"+ i +"\" src=\"" + (sty[i]<sp_rel ? snowflake2 : snowflake1 ) + "\" border=\"0\" alt=\"789\"></div>";
	}
	
	document.getElementById('snow').innerHTML = div;	
	return 1;
}

function WeatherBegin() {  // IE main animation function
	
	for (i = 0; i < no; ++ i) {  // iterate for every dot
		yp[i] += sty[i] < sp_rel ? sty[i]/2 : sty[i];
		if (yp[i] > doc_height-40) {
			SetVariable(i);
			var im = document.all['im'+i];
			im.src = (sty[i] < sp_rel) ? snowflake2 : snowflake1;
		}
		dx[i] += stx[i];
		document.all["dot"+i].style.pixelTop = yp[i];
		document.all["dot"+i].style.pixelLeft = xp[i] +  am[i]*Math.sin(dx[i]);
	}
	setTimeout("WeatherBegin()", speed);
}



