
function InitGames()
{
	document.panel0.imorphy10.value=GMS(m0, n0, 0, b0, 'morphy1g0.htm');
	document.panel1.imorphy11.value=GMS(m1, n1, 1, b1, 'morphy1g1.htm');
	document.panel2.imorphy12.value=GMS(m2, n2, 2, b2, 'morphy1g2.htm');
	document.panel3.imorphy13.value=GMS(m3, n3, 3, b3, 'morphy1g3.htm');
	document.panel4.imorphy14.value=GMS(m4, n4, 4, b4, 'morphy1g4.htm');
	document.panel5.imorphy15.value=GMS(m5, n5, 5, b5, 'morphy1g5.htm');
	document.panel6.imorphy16.value=GMS(m6, n6, 6, b6, 'morphy1g6.htm');
	document.panel7.imorphy17.value=GMS(m7, n7, 7, b7, 'morphy1g7.htm');
	document.panel8.imorphy18.value=GMS(m8, n8, 8, b8, 'morphy1g8.htm');
	document.panel9.imorphy19.value=GMS(m9, n9, 9, b9, 'morphy1g9.htm');
	document.panel10.imorphy110.value=GMS(m10, n10, 10, b10, 'morphy1g10.htm');
	document.panel11.imorphy111.value=GMS(m11, n11, 11, b11, 'morphy1g11.htm');
	document.panel12.imorphy112.value=GMS(m12, n12, 12, b12, 'morphy1g12.htm');
	document.panel13.imorphy113.value=GMS(m13, n13, 13, b13, 'morphy1g13.htm');
	document.panel14.imorphy114.value=GMS(m14, n14, 14, b14, 'morphy1g14.htm');
	document.panel15.imorphy115.value=GMS(m15, n15, 15, b15, 'morphy1g15.htm');
	document.panel16.imorphy116.value=GMS(m16, n16, 16, b16, 'morphy1g16.htm');
	document.panel17.imorphy117.value=GMS(m17, n17, 17, b17, 'morphy1g17.htm');
	document.panel18.imorphy118.value=GMS(m18, n18, 18, b18, 'morphy1g18.htm');
	document.panel19.imorphy119.value=GMS(m19, n19, 19, b19, 'morphy1g19.htm');
	document.panel20.imorphy120.value=GMS(m20, n20, 20, b20, 'morphy1g20.htm');
	document.panel21.imorphy121.value=GMS(m21, n21, 21, b21, 'morphy1g21.htm');
	document.panel22.imorphy122.value=GMS(m22, n22, 22, b22, 'morphy1g22.htm');
	document.panel23.imorphy123.value=GMS(m23, n23, 23, b23, 'morphy1g23.htm');
	document.panel24.imorphy124.value=GMS(m24, n24, 24, b24, 'morphy1g24.htm');
	document.panel25.imorphy125.value=GMS(m25, n25, 25, b25, 'morphy1g25.htm');
	document.panel26.imorphy126.value=GMS(m26, n26, 26, b26, 'morphy1g26.htm');
	document.panel27.imorphy127.value=GMS(m27, n27, 27, b27, 'morphy1g27.htm');
	document.panel28.imorphy128.value=GMS(m28, n28, 28, b28, 'morphy1g28.htm');
	document.panel29.imorphy129.value=GMS(m29, n29, 29, b29, 'morphy1g29.htm');
	document.panel30.imorphy130.value=GMS(m30, n30, 30, b30, 'morphy1g30.htm');
	document.panel31.imorphy131.value=GMS(m31, n31, 31, b31, 'morphy1g31.htm');
	document.panel32.imorphy132.value=GMS(m32, n32, 32, b32, 'morphy1g32.htm');
	document.panel33.imorphy133.value=GMS(m33, n33, 33, b33, 'morphy1g33.htm');
	document.panel34.imorphy134.value=GMS(m34, n34, 34, b34, 'morphy1g34.htm');
	document.panel35.imorphy135.value=GMS(m35, n35, 35, b35, 'morphy1g35.htm');
	document.panel36.imorphy136.value=GMS(m36, n36, 36, b36, 'morphy1g36.htm');
	document.panel37.imorphy137.value=GMS(m37, n37, 37, b37, 'morphy1g37.htm');
	document.panel38.imorphy138.value=GMS(m38, n38, 38, b38, 'morphy1g38.htm');
	document.panel39.imorphy139.value=GMS(m39, n39, 39, b39, 'morphy1g39.htm');
	document.panel40.imorphy140.value=GMS(m40, n40, 40, b40, 'morphy1g40.htm');
	document.panel41.imorphy141.value=GMS(m41, n41, 41, b41, 'morphy1g41.htm');
	document.panel42.imorphy142.value=GMS(m42, n42, 42, b42, 'morphy1g42.htm');
	document.panel43.imorphy143.value=GMS(m43, n43, 43, b43, 'morphy1g43.htm');
	document.panel44.imorphy144.value=GMS(m44, n44, 44, b44, 'morphy1g44.htm');
	document.panel45.imorphy145.value=GMS(m45, n45, 45, b45, 'morphy1g45.htm');
	document.panel46.imorphy146.value=GMS(m46, n46, 46, b46, 'morphy1g46.htm');
	document.panel47.imorphy147.value=GMS(m47, n47, 47, b47, 'morphy1g47.htm');
	document.panel48.imorphy148.value=GMS(m48, n48, 48, b48, 'morphy1g48.htm');
	document.panel49.imorphy149.value=GMS(m49, n49, 49, b49, 'morphy1g49.htm');
	document.panel50.imorphy150.value=GMS(m50, n50, 50, b50, 'morphy1g50.htm');
	document.panel51.imorphy151.value=GMS(m51, n51, 51, b51, 'morphy1g51.htm');
	document.panel52.imorphy152.value=GMS(m52, n52, 52, b52, 'morphy1g52.htm');
}

function MoveForwardAnim()
{
	if ( nMoves[0] < m0.length / 2 )
		b0=MF(m0, n0, 0, b0, 'morphy1g0.htm');
	else
		b0=GoStart(m0, n0, 0, b0, 'morphy1g0.htm');
	document.panel0.imorphy10.value=GMS(m0, n0, 0, b0, 'morphy1g0.htm');
	if ( nMoves[1] < m1.length / 2 )
		b1=MF(m1, n1, 1, b1, 'morphy1g1.htm');
	else
		b1=GoStart(m1, n1, 1, b1, 'morphy1g1.htm');
	document.panel1.imorphy11.value=GMS(m1, n1, 1, b1, 'morphy1g1.htm');
	if ( nMoves[2] < m2.length / 2 )
		b2=MF(m2, n2, 2, b2, 'morphy1g2.htm');
	else
		b2=GoStart(m2, n2, 2, b2, 'morphy1g2.htm');
	document.panel2.imorphy12.value=GMS(m2, n2, 2, b2, 'morphy1g2.htm');
	if ( nMoves[3] < m3.length / 2 )
		b3=MF(m3, n3, 3, b3, 'morphy1g3.htm');
	else
		b3=GoStart(m3, n3, 3, b3, 'morphy1g3.htm');
	document.panel3.imorphy13.value=GMS(m3, n3, 3, b3, 'morphy1g3.htm');
	if ( nMoves[4] < m4.length / 2 )
		b4=MF(m4, n4, 4, b4, 'morphy1g4.htm');
	else
		b4=GoStart(m4, n4, 4, b4, 'morphy1g4.htm');
	document.panel4.imorphy14.value=GMS(m4, n4, 4, b4, 'morphy1g4.htm');
	if ( nMoves[5] < m5.length / 2 )
		b5=MF(m5, n5, 5, b5, 'morphy1g5.htm');
	else
		b5=GoStart(m5, n5, 5, b5, 'morphy1g5.htm');
	document.panel5.imorphy15.value=GMS(m5, n5, 5, b5, 'morphy1g5.htm');
	if ( nMoves[6] < m6.length / 2 )
		b6=MF(m6, n6, 6, b6, 'morphy1g6.htm');
	else
		b6=GoStart(m6, n6, 6, b6, 'morphy1g6.htm');
	document.panel6.imorphy16.value=GMS(m6, n6, 6, b6, 'morphy1g6.htm');
	if ( nMoves[7] < m7.length / 2 )
		b7=MF(m7, n7, 7, b7, 'morphy1g7.htm');
	else
		b7=GoStart(m7, n7, 7, b7, 'morphy1g7.htm');
	document.panel7.imorphy17.value=GMS(m7, n7, 7, b7, 'morphy1g7.htm');
	if ( nMoves[8] < m8.length / 2 )
		b8=MF(m8, n8, 8, b8, 'morphy1g8.htm');
	else
		b8=GoStart(m8, n8, 8, b8, 'morphy1g8.htm');
	document.panel8.imorphy18.value=GMS(m8, n8, 8, b8, 'morphy1g8.htm');
	if ( nMoves[9] < m9.length / 2 )
		b9=MF(m9, n9, 9, b9, 'morphy1g9.htm');
	else
		b9=GoStart(m9, n9, 9, b9, 'morphy1g9.htm');
	document.panel9.imorphy19.value=GMS(m9, n9, 9, b9, 'morphy1g9.htm');
	if ( nMoves[10] < m10.length / 2 )
		b10=MF(m10, n10, 10, b10, 'morphy1g10.htm');
	else
		b10=GoStart(m10, n10, 10, b10, 'morphy1g10.htm');
	document.panel10.imorphy110.value=GMS(m10, n10, 10, b10, 'morphy1g10.htm');
	if ( nMoves[11] < m11.length / 2 )
		b11=MF(m11, n11, 11, b11, 'morphy1g11.htm');
	else
		b11=GoStart(m11, n11, 11, b11, 'morphy1g11.htm');
	document.panel11.imorphy111.value=GMS(m11, n11, 11, b11, 'morphy1g11.htm');
	if ( nMoves[12] < m12.length / 2 )
		b12=MF(m12, n12, 12, b12, 'morphy1g12.htm');
	else
		b12=GoStart(m12, n12, 12, b12, 'morphy1g12.htm');
	document.panel12.imorphy112.value=GMS(m12, n12, 12, b12, 'morphy1g12.htm');
	if ( nMoves[13] < m13.length / 2 )
		b13=MF(m13, n13, 13, b13, 'morphy1g13.htm');
	else
		b13=GoStart(m13, n13, 13, b13, 'morphy1g13.htm');
	document.panel13.imorphy113.value=GMS(m13, n13, 13, b13, 'morphy1g13.htm');
	if ( nMoves[14] < m14.length / 2 )
		b14=MF(m14, n14, 14, b14, 'morphy1g14.htm');
	else
		b14=GoStart(m14, n14, 14, b14, 'morphy1g14.htm');
	document.panel14.imorphy114.value=GMS(m14, n14, 14, b14, 'morphy1g14.htm');
	if ( nMoves[15] < m15.length / 2 )
		b15=MF(m15, n15, 15, b15, 'morphy1g15.htm');
	else
		b15=GoStart(m15, n15, 15, b15, 'morphy1g15.htm');
	document.panel15.imorphy115.value=GMS(m15, n15, 15, b15, 'morphy1g15.htm');
	if ( nMoves[16] < m16.length / 2 )
		b16=MF(m16, n16, 16, b16, 'morphy1g16.htm');
	else
		b16=GoStart(m16, n16, 16, b16, 'morphy1g16.htm');
	document.panel16.imorphy116.value=GMS(m16, n16, 16, b16, 'morphy1g16.htm');
	if ( nMoves[17] < m17.length / 2 )
		b17=MF(m17, n17, 17, b17, 'morphy1g17.htm');
	else
		b17=GoStart(m17, n17, 17, b17, 'morphy1g17.htm');
	document.panel17.imorphy117.value=GMS(m17, n17, 17, b17, 'morphy1g17.htm');
	if ( nMoves[18] < m18.length / 2 )
		b18=MF(m18, n18, 18, b18, 'morphy1g18.htm');
	else
		b18=GoStart(m18, n18, 18, b18, 'morphy1g18.htm');
	document.panel18.imorphy118.value=GMS(m18, n18, 18, b18, 'morphy1g18.htm');
	if ( nMoves[19] < m19.length / 2 )
		b19=MF(m19, n19, 19, b19, 'morphy1g19.htm');
	else
		b19=GoStart(m19, n19, 19, b19, 'morphy1g19.htm');
	document.panel19.imorphy119.value=GMS(m19, n19, 19, b19, 'morphy1g19.htm');
	if ( nMoves[20] < m20.length / 2 )
		b20=MF(m20, n20, 20, b20, 'morphy1g20.htm');
	else
		b20=GoStart(m20, n20, 20, b20, 'morphy1g20.htm');
	document.panel20.imorphy120.value=GMS(m20, n20, 20, b20, 'morphy1g20.htm');
	if ( nMoves[21] < m21.length / 2 )
		b21=MF(m21, n21, 21, b21, 'morphy1g21.htm');
	else
		b21=GoStart(m21, n21, 21, b21, 'morphy1g21.htm');
	document.panel21.imorphy121.value=GMS(m21, n21, 21, b21, 'morphy1g21.htm');
	if ( nMoves[22] < m22.length / 2 )
		b22=MF(m22, n22, 22, b22, 'morphy1g22.htm');
	else
		b22=GoStart(m22, n22, 22, b22, 'morphy1g22.htm');
	document.panel22.imorphy122.value=GMS(m22, n22, 22, b22, 'morphy1g22.htm');
	if ( nMoves[23] < m23.length / 2 )
		b23=MF(m23, n23, 23, b23, 'morphy1g23.htm');
	else
		b23=GoStart(m23, n23, 23, b23, 'morphy1g23.htm');
	document.panel23.imorphy123.value=GMS(m23, n23, 23, b23, 'morphy1g23.htm');
	if ( nMoves[24] < m24.length / 2 )
		b24=MF(m24, n24, 24, b24, 'morphy1g24.htm');
	else
		b24=GoStart(m24, n24, 24, b24, 'morphy1g24.htm');
	document.panel24.imorphy124.value=GMS(m24, n24, 24, b24, 'morphy1g24.htm');
	if ( nMoves[25] < m25.length / 2 )
		b25=MF(m25, n25, 25, b25, 'morphy1g25.htm');
	else
		b25=GoStart(m25, n25, 25, b25, 'morphy1g25.htm');
	document.panel25.imorphy125.value=GMS(m25, n25, 25, b25, 'morphy1g25.htm');
	if ( nMoves[26] < m26.length / 2 )
		b26=MF(m26, n26, 26, b26, 'morphy1g26.htm');
	else
		b26=GoStart(m26, n26, 26, b26, 'morphy1g26.htm');
	document.panel26.imorphy126.value=GMS(m26, n26, 26, b26, 'morphy1g26.htm');
	if ( nMoves[27] < m27.length / 2 )
		b27=MF(m27, n27, 27, b27, 'morphy1g27.htm');
	else
		b27=GoStart(m27, n27, 27, b27, 'morphy1g27.htm');
	document.panel27.imorphy127.value=GMS(m27, n27, 27, b27, 'morphy1g27.htm');
	if ( nMoves[28] < m28.length / 2 )
		b28=MF(m28, n28, 28, b28, 'morphy1g28.htm');
	else
		b28=GoStart(m28, n28, 28, b28, 'morphy1g28.htm');
	document.panel28.imorphy128.value=GMS(m28, n28, 28, b28, 'morphy1g28.htm');
	if ( nMoves[29] < m29.length / 2 )
		b29=MF(m29, n29, 29, b29, 'morphy1g29.htm');
	else
		b29=GoStart(m29, n29, 29, b29, 'morphy1g29.htm');
	document.panel29.imorphy129.value=GMS(m29, n29, 29, b29, 'morphy1g29.htm');
	if ( nMoves[30] < m30.length / 2 )
		b30=MF(m30, n30, 30, b30, 'morphy1g30.htm');
	else
		b30=GoStart(m30, n30, 30, b30, 'morphy1g30.htm');
	document.panel30.imorphy130.value=GMS(m30, n30, 30, b30, 'morphy1g30.htm');
	if ( nMoves[31] < m31.length / 2 )
		b31=MF(m31, n31, 31, b31, 'morphy1g31.htm');
	else
		b31=GoStart(m31, n31, 31, b31, 'morphy1g31.htm');
	document.panel31.imorphy131.value=GMS(m31, n31, 31, b31, 'morphy1g31.htm');
	if ( nMoves[32] < m32.length / 2 )
		b32=MF(m32, n32, 32, b32, 'morphy1g32.htm');
	else
		b32=GoStart(m32, n32, 32, b32, 'morphy1g32.htm');
	document.panel32.imorphy132.value=GMS(m32, n32, 32, b32, 'morphy1g32.htm');
	if ( nMoves[33] < m33.length / 2 )
		b33=MF(m33, n33, 33, b33, 'morphy1g33.htm');
	else
		b33=GoStart(m33, n33, 33, b33, 'morphy1g33.htm');
	document.panel33.imorphy133.value=GMS(m33, n33, 33, b33, 'morphy1g33.htm');
	if ( nMoves[34] < m34.length / 2 )
		b34=MF(m34, n34, 34, b34, 'morphy1g34.htm');
	else
		b34=GoStart(m34, n34, 34, b34, 'morphy1g34.htm');
	document.panel34.imorphy134.value=GMS(m34, n34, 34, b34, 'morphy1g34.htm');
	if ( nMoves[35] < m35.length / 2 )
		b35=MF(m35, n35, 35, b35, 'morphy1g35.htm');
	else
		b35=GoStart(m35, n35, 35, b35, 'morphy1g35.htm');
	document.panel35.imorphy135.value=GMS(m35, n35, 35, b35, 'morphy1g35.htm');
	if ( nMoves[36] < m36.length / 2 )
		b36=MF(m36, n36, 36, b36, 'morphy1g36.htm');
	else
		b36=GoStart(m36, n36, 36, b36, 'morphy1g36.htm');
	document.panel36.imorphy136.value=GMS(m36, n36, 36, b36, 'morphy1g36.htm');
	if ( nMoves[37] < m37.length / 2 )
		b37=MF(m37, n37, 37, b37, 'morphy1g37.htm');
	else
		b37=GoStart(m37, n37, 37, b37, 'morphy1g37.htm');
	document.panel37.imorphy137.value=GMS(m37, n37, 37, b37, 'morphy1g37.htm');
	if ( nMoves[38] < m38.length / 2 )
		b38=MF(m38, n38, 38, b38, 'morphy1g38.htm');
	else
		b38=GoStart(m38, n38, 38, b38, 'morphy1g38.htm');
	document.panel38.imorphy138.value=GMS(m38, n38, 38, b38, 'morphy1g38.htm');
	if ( nMoves[39] < m39.length / 2 )
		b39=MF(m39, n39, 39, b39, 'morphy1g39.htm');
	else
		b39=GoStart(m39, n39, 39, b39, 'morphy1g39.htm');
	document.panel39.imorphy139.value=GMS(m39, n39, 39, b39, 'morphy1g39.htm');
	if ( nMoves[40] < m40.length / 2 )
		b40=MF(m40, n40, 40, b40, 'morphy1g40.htm');
	else
		b40=GoStart(m40, n40, 40, b40, 'morphy1g40.htm');
	document.panel40.imorphy140.value=GMS(m40, n40, 40, b40, 'morphy1g40.htm');
	if ( nMoves[41] < m41.length / 2 )
		b41=MF(m41, n41, 41, b41, 'morphy1g41.htm');
	else
		b41=GoStart(m41, n41, 41, b41, 'morphy1g41.htm');
	document.panel41.imorphy141.value=GMS(m41, n41, 41, b41, 'morphy1g41.htm');
	if ( nMoves[42] < m42.length / 2 )
		b42=MF(m42, n42, 42, b42, 'morphy1g42.htm');
	else
		b42=GoStart(m42, n42, 42, b42, 'morphy1g42.htm');
	document.panel42.imorphy142.value=GMS(m42, n42, 42, b42, 'morphy1g42.htm');
	if ( nMoves[43] < m43.length / 2 )
		b43=MF(m43, n43, 43, b43, 'morphy1g43.htm');
	else
		b43=GoStart(m43, n43, 43, b43, 'morphy1g43.htm');
	document.panel43.imorphy143.value=GMS(m43, n43, 43, b43, 'morphy1g43.htm');
	if ( nMoves[44] < m44.length / 2 )
		b44=MF(m44, n44, 44, b44, 'morphy1g44.htm');
	else
		b44=GoStart(m44, n44, 44, b44, 'morphy1g44.htm');
	document.panel44.imorphy144.value=GMS(m44, n44, 44, b44, 'morphy1g44.htm');
	if ( nMoves[45] < m45.length / 2 )
		b45=MF(m45, n45, 45, b45, 'morphy1g45.htm');
	else
		b45=GoStart(m45, n45, 45, b45, 'morphy1g45.htm');
	document.panel45.imorphy145.value=GMS(m45, n45, 45, b45, 'morphy1g45.htm');
	if ( nMoves[46] < m46.length / 2 )
		b46=MF(m46, n46, 46, b46, 'morphy1g46.htm');
	else
		b46=GoStart(m46, n46, 46, b46, 'morphy1g46.htm');
	document.panel46.imorphy146.value=GMS(m46, n46, 46, b46, 'morphy1g46.htm');
	if ( nMoves[47] < m47.length / 2 )
		b47=MF(m47, n47, 47, b47, 'morphy1g47.htm');
	else
		b47=GoStart(m47, n47, 47, b47, 'morphy1g47.htm');
	document.panel47.imorphy147.value=GMS(m47, n47, 47, b47, 'morphy1g47.htm');
	if ( nMoves[48] < m48.length / 2 )
		b48=MF(m48, n48, 48, b48, 'morphy1g48.htm');
	else
		b48=GoStart(m48, n48, 48, b48, 'morphy1g48.htm');
	document.panel48.imorphy148.value=GMS(m48, n48, 48, b48, 'morphy1g48.htm');
	if ( nMoves[49] < m49.length / 2 )
		b49=MF(m49, n49, 49, b49, 'morphy1g49.htm');
	else
		b49=GoStart(m49, n49, 49, b49, 'morphy1g49.htm');
	document.panel49.imorphy149.value=GMS(m49, n49, 49, b49, 'morphy1g49.htm');
	if ( nMoves[50] < m50.length / 2 )
		b50=MF(m50, n50, 50, b50, 'morphy1g50.htm');
	else
		b50=GoStart(m50, n50, 50, b50, 'morphy1g50.htm');
	document.panel50.imorphy150.value=GMS(m50, n50, 50, b50, 'morphy1g50.htm');
	if ( nMoves[51] < m51.length / 2 )
		b51=MF(m51, n51, 51, b51, 'morphy1g51.htm');
	else
		b51=GoStart(m51, n51, 51, b51, 'morphy1g51.htm');
	document.panel51.imorphy151.value=GMS(m51, n51, 51, b51, 'morphy1g51.htm');
	if ( nMoves[52] < m52.length / 2 )
		b52=MF(m52, n52, 52, b52, 'morphy1g52.htm');
	else
		b52=GoStart(m52, n52, 52, b52, 'morphy1g52.htm');
	document.panel52.imorphy152.value=GMS(m52, n52, 52, b52, 'morphy1g52.htm');
	window.setTimeout( "MoveForwardAnim()", 1000 );
}
// Copyright 98,99 by ChessBase GmbH, Germany
function Init( path )
{ gifs = new Array(6);
	for ( var i=0; i< 26; i++)
		gifs[i]= new Image();
	gifs[0].src = path + "b.gif";
	gifs[1].src = path + "bbb.gif";
	gifs[2].src = path + "bbw.gif";
	gifs[3].src = path + "bkb.gif";
	gifs[4].src = path + "bkw.gif";
	gifs[5].src = path + "bqb.gif";
	gifs[6].src = path + "bqw.gif";
	gifs[7].src = path + "brb.gif";
	gifs[8].src = path + "brw.gif";
	gifs[9].src = path + "bnb.gif";
	gifs[10].src = path + "bnw.gif";
	gifs[11].src = path + "wbb.gif";
	gifs[12].src = path + "wbw.gif";
	gifs[13].src = path + "wrb.gif";
	gifs[14].src = path + "wrw.gif";
	gifs[15].src = path + "wqb.gif";
	gifs[16].src = path + "wqw.gif";
	gifs[17].src = path + "wkb.gif";
	gifs[18].src = path + "wkw.gif";
	gifs[19].src = path + "wnb.gif";
	gifs[20].src = path + "wnw.gif";
	gifs[21].src = path + "wpb.gif";
	gifs[22].src = path + "wpw.gif";
	gifs[23].src = path + "bpb.gif";
	gifs[24].src = path + "wpb.gif";
	gifs[25].src = path + "b.gif";
}
function SyncPicture( base, basename )
{	if ( base > -1 ) return base;
	for ( i=0; i < document.images.length; i++ )
	{	if ( document.images[i].name != "" )
			if ( document.images[i].name == basename )
				return i;
			else if ( document.images[i].name.substring(0,3) == basename.substring(0,3) )
				i+= 63;
	}
	return -1;
}
function MF5( moves, names, nm, base, basename )
{	base = SyncPicture( base, basename );
	for ( i=0; nMoves[nm] < moves.length / 2 && i < 10; i++ )
		MF( moves, names, nm, base );
	return base;
}
function MB5( moves, names, nm, base, basename )
{	base = SyncPicture( base, basename );
	for ( i=0; nMoves[nm] > 0 && i < 10; i++ )
		MB( moves, names, nm, base );
	return base;
}
function GoStart( moves, names, nm, base, basename )
{	base = SyncPicture( base, basename );
	while ( nMoves[nm] > 0 )
		MB( moves, names, nm, base );
	return base;
}
function GoEnd( moves, names, nm, base, basename )
{	base = SyncPicture( base, basename );
	while ( nMoves[nm] < moves.length / 2 )
		MF( moves, names, nm, base );
	return base;
}
function MF( moves, names, nm, base, basename )
{	base = SyncPicture( base, basename );
	if ( nMoves[nm] < moves.length / 2 )
	{	var n = nMoves[nm]*2;
		var from = moves[ n ] & 0x3f;
		var to = moves[ n+1 ] & 0x3f;
		names[ n   ] = document.images[ base + from ].src;
		names[ n+1 ] = document.images[ base + to ].src;
		var len = names[n].length;
		var nn = (Math.floor(( to / 8 )) + ( to % 8 ));
		var dest = ( nn % 2 ) == 1 ? "b" : "w";
		var piece = names[n].substring(len-6,len-5);
		if (( moves[ n ] & 0x380 ) == 0x80 )
			piece = "q";
		else if (( moves[ n ] & 0x380 ) == 0x100 )
			piece = "n";
		else if (( moves[ n ] & 0x380 ) == 0x180 )
			piece = "b";
		else if (( moves[ n ] & 0x380 ) == 0x200 )
			piece = "r";
		document.images[ base + to ].src = names[n].substring(0,len-6) + piece + dest + names[n].substring(len-4,len);
		nn = (Math.floor(( from / 8 )) + ( from % 8 ));
		if (( nn % 2 ) == 1 )
			document.images[ base + from ].src = EmptyBlackPath;
		else
			document.images[ base + from ].src = EmptyWhitePath;
		nMoves[nm]++;
		if ( nMoves[nm] < moves.length / 2 && ( moves[ nMoves[nm]*2 ] & 0x40 ) == 0x40 )
			MF( moves, names, nm, base );
	}
	return base
}
function MB( moves, names, nm, base, basename )
{	base = SyncPicture( base, basename );
	if ( nMoves[nm] > 0 )
	{	nMoves[nm]--;
		var from = moves[ nMoves[nm]*2 ] & 0x3f;
		var to = moves[ nMoves[nm]*2+1 ] & 0x3f;
		document.images[ base + from ].src = names[ nMoves[nm]*2 ];
		document.images[ base + to ].src = names[ nMoves[nm]*2+1 ];
		if (( moves[ nMoves[nm]*2 ] & 0x40 ) == 0x40 )
			MB( moves, names, nm, base );
	}
	return base;
}
function GMS( moves, names, nm, base, basename )
{	base = SyncPicture( base, basename );
	if ( nMoves[nm] > 0 && nMoves[nm] <= moves.length / 2 )
	{	var n = (nMoves[nm]-1)*2;
		var from = moves[ n ] & 0x3f;
		var to = moves[ n+1 ] & 0x3f;
		var len = document.images[ base + to ].src.length;
		var piece = document.images[ base + to ].src.substring(len-6,len-5);
		if ( piece == "q" )
			piece = pieces.substring(1,2);
		else if ( piece == "r" )
			piece = pieces.substring(4,5);
		else if ( piece == "b" )
			piece = pieces.substring(3,4);
		else if ( piece == "n" )
			piece = pieces.substring(2,3);
		else if ( piece == "k" )
			piece = pieces.substring(0,1);
		else piece = pieces.substring(5,6);
		var piece2 = "";
		if (( moves[ n ] & 0x380 ) == 0x80 )
			piece2 = pieces.substring(1,2);
		else if (( moves[ n ] & 0x380 ) == 0x100 )
			piece2 = pieces.substring(2,3);
		else if (( moves[ n ] & 0x380 ) == 0x180 )
			piece2 = pieces.substring(3,4);
		else if (( moves[ n ] & 0x380 ) == 0x200 )
			piece2 = pieces.substring(4,5);
		var lines = "abcdefgh";
		var rows = "87654321";
		var fromLine = from%8;
		var fromRow = Math.floor(from/8);
		var toLine = to%8;
		var toRow = Math.floor(to/8);
		var off=1;
		for ( i=0; i <= n; i += 2 )
			if (( moves[i] & 0x40 ) == 0x40 )
				off = off+1;
		var result = (Math.floor((nMoves[nm]-off)/2)+1).toString() + ". ";
		if ( document.images[ base + to ].src.substring(len-7,len-6) == "b" )
			result = result + "... ";
		if ( n >= 2 && (( moves[n] & 0x40 ) == 0x40 ))
		{	if (( moves[n-1] == 62 ) || ( moves[n-1] == 6 ))
				result = result + "0-0"
			else if (( moves[n-1] == 2 + 7 * 8 ) || ( moves[n-1] == 2 + 0 * 8 ))
				result = result + "0-0-0"
			else
			{	var sep = "x";
				from = moves[ n-2 ] & 0x3f;
				to = moves[ n-1 ] & 0x3f;
				fromLine = from%8;
				fromRow = Math.floor(from/8);
				toLine = to%8;
				toRow = Math.floor(to/8);
				result = result	+ lines.substring( fromLine, fromLine+1 ) + rows.substring( fromRow, fromRow+1 )
										+ sep
										+ lines.substring( toLine, toLine+1 ) + rows.substring( toRow, toRow+1 )
										+ piece2 + " ep";
			}
		}
		else
		{	var len = names[ n+1 ].length;
			var substr = names[ n+1 ].substring( len-6, len );
			var sep = (( substr == "/w.gif" ) || ( substr == "\\w.gif" ) ||
						  ( substr == "/b.gif" ) || ( substr == "\\b.gif" )) ? "-" : "x";
			if ( piece2 != "" ) piece = "";
			result = result + piece.toUpperCase() + lines.substring( fromLine, fromLine+1 ) + rows.substring( fromRow, fromRow+1 )
				+ sep
				+ lines.substring( toLine, toLine+1 ) + rows.substring( toRow, toRow+1 )
				+ piece2;
		}
		return result;
	}
	return "";
}

