   var ti=false;
   



function   prev(w)
{

if (ti)
{

if (w==0)
{PREV.src='demo/data/images/0.gif';
preV.style.visibility="hidden";
}else{

  MouseX = event.clientX;
  MouseY = event.clientY+10;
  if (MouseX+400>xx)
  {preV.style.left = MouseX-400 + "px";
  }else{
        preV.style.left = MouseX + "px";
    }   
	   
	    preV.style.top = MouseY + "px";

PREV.src='demo/data/images/prev/'+w+'.gif';



preV.style.filter="blendTrans(duration=1)";
preV.filters.blendTrans.apply();
preV.style.visibility="visible";
preV.filters.blendTrans.play();
} 
} 
}



   
   function OpSm(q,a){







   
if (a=='') {a=0;}

aa=a;
qq=q;

TDD='';
TDD1='';
TDD2='';
tdt='';
tdb='';
tdr='';

tdt1='';

tdr1='';
styles='0';
   if (uu[q]) styles=uu[q].split(", ");
  
  lr=styles.length/2;
   
  for(i=0;i<lr;i++) 
  { 
  
y=styles[i].substring(0,38);
  
if (i+1<10)
{ia='0'+(i+1)}
else
{ia=i+1}

  TDD=TDD+"<td class='tdd1'>"+(ia)+"</td>";
  

  
  
  
  
  
  

if (a==i)
{
if (styles[i].substring(39,40)==1)  
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="g0" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';

}
else if (styles[i].substring(39,40)==0)  
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="r0" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';

}
else if (styles[i].substring(39,40)==3)  
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="a0" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
else
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="o0" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
}else{


if (styles[i].substring(39,40)==1)  
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="g" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
else if (styles[i].substring(39,40)==0)  
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="r" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
else if (styles[i].substring(39,40)==3)  
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="a" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
else 
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="o" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
}
}

ii=i;

  for(i=ii;i<styles.length;i++) 
  { y=styles[i].substring(0,38);
if (i+1<10)
{ia="0"+(i+1)}
else
{ia=i+1}

  TDD=TDD+'<td class="tdd1">'+(ia)+'</td>';

if (a==i)
{
if (styles[i].substring(39,40)==1)  
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="g0" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
else if (styles[i].substring(39,40)==0)  
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="r0" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
else if (styles[i].substring(39,40)==3)  
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="aR0" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
else
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="o0" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
}else{


if (styles[i].substring(39,40)==1)  
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="g" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
else if (styles[i].substring(39,40)==0)  
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="r" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
else if (styles[i].substring(39,40)==3)  
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="aR" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
else 
{TDD1=TDD1+'<td valign="top" class="tdd2"><a href="#" onClick="OpSm('+q+','+i+');" class="o" id="t_'+i+'" onMouseOut="prev(0);" onMouseOver="prev(\''+y+'\');"><img src="/Images/0.gif" width="19" height="22" alt="" border="0" /></a></td>';
}
}
}	
  
  

  
  
  
  
  
  
  
  
  
  
  
  
  




y=styles[a].substring(0,38)
yy=y.substring(1, 3);


if(par=='rG')
{

document.getElementById('tableT').style.background = "url(/img/gr_po.gif)";
//padding: 0px 89px 0px 89px; background-repeat: no-repeat; width: 100% height: 602px; background-image: url(/img/gr_po.gif); "

ShockwaveFlash='<div style="width: 828px; height: 602px;  position: absolute; margin-left: 88px; margin-top: 0px;" width="828" height="602"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" width="100%" height="100%" align="top" name="KM1" id="KM"><PARAM NAME=bgcolor VALUE ="#ffffff"><param name=movie  VALUE="/demo/data/Files/'+yy+'/'+y+'.swf"><param name=quality value=high><PARAM NAME=menu VALUE=false> <param name="wmode" value="opaque"><embed src="/demo/data/Files/'+yy+'/'+y+'.swf" quality=high wmode="opaque" bgcolor="#ffffff" swLiveConnect=true NAME=KM  width="100%" height="100%" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></div>';

}
else
{

document.getElementById('tableT').style.background = "url(img/0.gif)";

ShockwaveFlash='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" width="100%" height="100%" align="top" name="KM1" id="KM"><PARAM NAME=bgcolor VALUE ="#ffffff"><param name=movie  VALUE="/demo/data/Files/'+yy+'/'+y+'.swf"><param name=quality value=high><PARAM NAME=menu VALUE=false> <param name="wmode" value="opaque"><embed src="/demo/data/Files/'+yy+'/'+y+'.swf" quality=high wmode="opaque" bgcolor="#ffffff" swLiveConnect=true NAME=KM  width="100%" height="100%" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';



}

tbB='<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td nowrap width="16" height="40" > &nbsp; &nbsp; </td><td width="20" align="left" valign="middle" nowrap style=" font-weight: bold;"></td><td valign="middle"  width="800"></td><td width="70" valign="middle" nowrap> ';





tbB=tbB+'</td>';





 tbB=tbB+'<td align="right" valign="middle" nowrap  class="t3"> <b>Управление уроком&nbsp;&nbsp;&nbsp;</b></td><td width="100" align="center" valign="middle" nowrap>';


if (a==0)
{
//tbB=tbB+'<img src="demo/data/images/begin0.jpg" alt="" width="84" hspace="5" height="33" border="0" align="absmiddle">';
tbB=tbB+'<div class="ke0"  style="width: 87px;"></div></td><td  align="right" valign="middle"   nowrap   style="width: 70px;">';
tbB=tbB+'<img src="/Images/menu/pr0.gif" alt="" width="21" height="19" hspace="4" border="0" align="absmiddle">';
}
else
{
//tbB=tbB+'<img src="demo/data/images/begin.jpg" alt="Перейти на первую часть урока" width="84" hspace="5" height="33" border="0" align="absmiddle" onMouseOver="this.src=\'data/images/begin1.jpg\'" onMouseOut="this.src=\'data/images/begin.jpg\'" onClick="OpSm('+q+',0)" >';

tbB=tbB+'<div class="key2"  onClick="OpSm('+q+',0)" style="cursor: pointer; width: 87px"> </div></td><td align="right" valign="middle" nowrap   style="width: 70px;">';

tbB=tbB+'<img src="/Images/menu/pr.gif" alt="Перейти на предыдущую часть урока" width="21" height="19" hspace="4" border="0" align="absmiddle"  onMouseOver="this.src=\'/Images/menu/pr1.gif\'" onMouseOut="this.src=\'/Images/menu/pr.gif\'" onClick="OpSm('+q+','+(a-1)+')" >';
}

if (a==i-1)
{
tbB=tbB+'<img src="/Images/menu/nx0.gif" alt="" width="21" height="19" hspace="4" border="0" align="absmiddle" >';
}
else
{
tbB=tbB+'<img src="/Images/menu/nx.gif" alt="Перейти на следующую часть урока" width="21" height="19" hspace="4" border="0" align="absmiddle" onMouseOver="this.src=\'/Images/menu/nx1.gif\'" onMouseOut="this.src=\'/Images/menu/nx.gif\'" onClick="OpSm('+q+','+(a+1)+')" >';


}

tbB=tbB+'</td>';



tbB=tbB+'</tr></table>';

document.getElementById('menuWB').innerHTML=u[q];
window.document.title = name+u[q];


document.getElementById('pred').innerHTML=name;


mimgClose();

document.getElementById('tableTDD').innerHTML='<table border="0" cellspacing="0" cellpadding="0"><tr>'+TDD+'</tr><tr valign="top">'+TDD1+'</tr></table>';
document.getElementById('tableT').style.visibility='visible';
document.getElementById('tableT').innerHTML=ShockwaveFlash;	

document.getElementById('tableB').innerHTML=tbB;

}
   
   
  
  
  
  
  
  
function OpSmI(q){


var styles=uM[q].split('~, ~');

y=styles[1].substring(0,38)
yy=y.substring(1, 3);
//margin : 22 128 22 128;

ShockwaveFlash='<div style="position: absolute; margin-left: 128px; margin-top: 22px; "><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"  	codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=6,0,0,0" 	ID=KMGAME width="743" height="556"> <PARAM NAME=movie VALUE="/Pgamecontainer24.swf?GameURL=/demo/data/Files/'+yy+'/'+y+'.swf"><PARAM NAME=bgcolor VALUE ="#47AEF4"><PARAM NAME=loop VALUE=false><PARAM NAME=menu VALUE=false><param name="wmode" value="opaque"><PARAM NAME=quality VALUE=high><PARAM NAME=bgcolor VALUE="#47AEF4"><embed src="/Pgamecontainer24.swf?GameURL=/demo/data/Files/'+yy+'/'+y+'.swf" quality=high wmode="opaque" bgcolor="#47AEF4" swLiveConnect=true NAME=KM  width="743" height="556" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></div>';

//ShockwaveFlash='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" width="100%" height="100%" align="top" name="KM1" id="KM"><PARAM NAME=bgcolor VALUE ="#47AEF4"><param name=movie  VALUE="demo/data/Files/'+yy+'/'+y+'.swf"><param name=quality value=high><PARAM NAME=menu VALUE=false> <param name="wmode" value="opaque"><embed src="demo/data/Files/'+yy+'/'+y+'.swf" quality=high wmode="opaque" bgcolor="#47AEF4" swLiveConnect=true NAME=KM  width="100%" height="100%" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';


document.getElementById('tableB').innerHTML='';
window.document.title = name;
document.getElementById('pred').innerHTML=name;
document.getElementById('tableTDD').innerHTML='';


document.getElementById('tableT').style.background = "url(/img/txtram.gif)";



document.getElementById('tableT').innerHTML='';

//document.getElementById('tableT').style.visibility='hidden';

document.getElementById('tableT').innerHTML=ShockwaveFlash;	


//mimgOpen();


//document.getElementById('tableMI').innerHTML=ShockwaveFlash;	

}
  
  
  
  

 
   

 function KM_DoFSCommand(command, args) {


if ((command=='exit') && (args=='1')) {MEHY('menu_exit')}

if ((command=='exit') && (args=='0')) {window.close();}



if ((command=="int") && (args=='3-4') && (!ti))  {par='int';  init('int'); OpSmI(1);}
if ((command=="int") && (args=='1-2') && (!ti))  {par='int';  init('int'); OpSmI(1);}

if ((command=="eng") && 		(args=='0'))  {MEHY('menu_eng')}
if ((command=="math") && 		(args=='0'))  {MEHY('menu_math')}
if ((command=="rus") && 		(args=='0'))  	{MEHY('menu_rus')}
if ((command=="int") && 		(args=='0'))  {par='int';  init('int'); OpSmI(1);}//{MEHY('menu_int')}
if ((command=="mir") && 		(args=='0'))  	{MEHY('menu_mir')}
if ((command=="game") && 	(args=='0'))  	{par='game';  init('game'); OpSmI(1);}




if ((command=="eng") && (args=='1'))  {par='e1'; init('e1'); OpSm(1,0);}

if ((command=="math") && (args=='1'))  {par='m1'; init('m1'); OpSm(1,0);}
if ((command=="math") && (args=='2'))  {par='m2'; init('m2'); OpSm(1,0);}
if ((command=="math") && (args=='3'))  {par='m3'; init('m3'); OpSm(1,0);}
if ((command=="math") && (args=='4'))  {par='m4'; init('m4'); OpSm(1,0);}


if ((command=="rus") && (args=='G'))  {par='rG'; init('rG'); OpSm(1,0);}

if ((command=="rus") && (args=='1'))  {par='r1'; init('r1'); OpSm(1,0);}
if ((command=="rus") && (args=='2'))  {par='r2'; init('r2'); OpSm(1,0);}
if ((command=="rus") && (args=='3'))  {par='r3'; init('r3'); OpSm(1,0);}
if ((command=="rus") && (args=='4'))  {par='r4'; init('r4'); OpSm(1,0);}


if ((command=="mir") && (args=='1'))  {par='o1'; init('o1'); OpSm(1,0);}
if ((command=="mir") && (args=='2'))  {par='o2'; init('o2'); OpSm(1,0);}
if ((command=="mir") && (args=='3'))  {par='o3'; init('o3'); OpSm(1,0);}
if ((command=="mir") && (args=='4'))  {par='o4'; init('o4'); OpSm(1,0);}

if ((command=="math") && (args=='a'))  {par='ma';  init('ma'); OpSmI(1);}
if ((command=="math") && (args=='i'))  {par='mi';  init('mi'); OpSmI(1);}

if ((command=="rus") && (args=='a'))  {par='ra';  init('ra'); OpSmI(1);}
if ((command=="rus") && (args=='i'))  {par='ri';  init('ri'); OpSmI(1);}
if ((command=="rus") && (args=='p'))  {par='rp';  init('rp'); OpSmI(1);}


if ((command=="mir") && (args=='a'))  {par='oa';  init('oa'); OpSmI(1);}
if ((command=="mir") && (args=='i'))  {par='oi';  init('oi'); OpSmI(1);}
if ((command=="mir") && (args=='p'))  {par='op';  init('op'); OpSmI(1);}
if ((command=="mir") && (args=='v'))  {par='ov';  init('ov'); OpSmI(1);}

document.getElementById('vp').style.visibility='hidden';





// для уроков математики и руского языка
var q0=y+"-0";
var q1=y+"-1";
var q2=y+"-2";




if (document.getElementById('tableT').innerHTML!='')
{


if (command=='[SWFResult01]')
{




if (args==rightanswer)
{







document.getElementById('t_'+aa).className='r0';

uu[qq]=uu[qq].replace(q2, q0);
uu[qq]=uu[qq].replace(q1, q0);






}else{
document.getElementById('t_'+aa).className='g0';

uu[qq]=uu[qq].replace(q2, q1);
uu[qq]=uu[qq].replace(q0, q1);







}

}

}





}   

   function OpJ()
   {
   location.href='/u.asp?j=1&reloads=1';
    
   }


   function mimgClose()
{
document.getElementById('mimg').style.visibility='hidden';
document.getElementById('tableMI').style.visibility='hidden';
document.getElementById('tableTXT').innerHTML='';
document.getElementById('tableMI').innerHTML='';

}


   function mimgOpen()
{
document.getElementById('mimg').style.visibility='visible';
document.getElementById('tableMI').style.visibility='visible';
document.getElementById('tableTXT').innerHTML='';
}