TEST COUNTDOWN_dig = new Image();
TEST COUNTDOWN_dig[0] = 'test countdown/0.gif';
TEST COUNTDOWN_dig[1] = 'test countdown/1.gif';
TEST COUNTDOWN_dig[2] = 'test countdown/2.gif';
TEST COUNTDOWN_dig[3] = 'test countdown/3.gif';
TEST COUNTDOWN_dig[4] = 'test countdown/4.gif';
TEST COUNTDOWN_dig[5] = 'test countdown/5.gif';
TEST COUNTDOWN_dig[6] = 'test countdown/6.gif';
TEST COUNTDOWN_dig[7] = 'test countdown/7.gif';
TEST COUNTDOWN_dig[8] = 'test countdown/8.gif';
TEST COUNTDOWN_dig[9] = 'test countdown/9.gif';
TEST COUNTDOWN_dig[10] = 'test countdown/empty.gif';
TEST COUNTDOWN_dig[11] = 'test countdown/3dots.gif';
function SetStrLength(Str, Length, FillSymbol)
{
 var ss = '' + Str + '';
 while (ss.length < Length) ss = FillSymbol + ss;

 if (ss.length > Length) {
  ss = ss.substr(0,Length-1);
  ss = ss + '-';
 }

 return ss;
}

function ShowMessage(sMessage, sSound)
{
 var screenW = 640, screenH = 480;
 if (parseInt(navigator.appVersion)>3)
 {
  screenW = screen.width;
  screenH = screen.height;
 }

 msg=window.open("","TimeLeft","width=300,height=200,left="+(screenW-300)/2+", top="+(screenH-300)/2+", resizable=yes, ");
 if (navigator.appName=="Microsoft Internet Explorer")
  msg.document.write('<bgsound src='+'"'+sSound+'"'+' >')
 else msg.document.write('<embed src=\"'+sSound+'\" hidden="true" border="0" width="20" height="20" autostart="true">');

 msg.document.write('<style type="text/css">');
 msg.document.write('.mess {color:#2D5C3D;font-family:Arial,helvetica,sans serif;font-size:13pt;font-weight:bold;}');
 msg.document.write('a.close {color:#618D6E;text-decoration:underline;font-family:verdana,helvetica,sans serif;font-size:11px;font-weight:bold;}');
 msg.document.write('</style>');

 msg.document.write('<body>');

 msg.document.write('<table width="100%" border="0">');
 msg.document.write('<tr><td height="140" class=mess valign="top">'+sMessage+'</td></tr>');
 msg.document.write('<tr><td height="*" class=close><hr size="1"><div align="center"><a class=close href=# onclick=self.close()>close</a></div></td></tr>');
 msg.document.write('</table>');

 msg.document.write('</body>');
}

function TEST COUNTDOWN_SetVal(Image, Str, Index)
{
 c = Str.charAt(Index);
 if (c==' ') c = '10';
 if (c=='-') c = '11';
 Image.src = TEST COUNTDOWN_dig[c];
}

function GetDayCount(iYear, iMonth)
{
 acMonth = new Array (31,28,31,30,31,30,31,31,30,31,30,31);
 if ((iYear % 4 == 0) && (iMonth == 1)) return 29;
 else {
  if (iMonth==0) iMonth = 11;
  return acMonth[iMonth];
 }
}
document.write('<div style="position:relative;width:144px;height:31px;">');
document.write('<image src="test countdown/bg.gif" align="top">');
document.write('<div style="position:absolute;top:0px;left:0px;width:144px;height:8px;">');
document.write('<image src="test countdown/p0.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:8px;left:0px;width:144px;height:8px;">');
document.write('<image src="test countdown/p1.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:1px;">');
document.write('<image src="test countdown/0.gif" name="TEST COUNTDOWN_n2_d2" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:11px;">');
document.write('<image src="test countdown/0.gif" name="TEST COUNTDOWN_n2_d1" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:24px;left:29px;">');
document.write('<image src="test countdown/t_46.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:42px;">');
document.write('<image src="test countdown/0.gif" name="TEST COUNTDOWN_n2_h2" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:52px;">');
document.write('<image src="test countdown/0.gif" name="TEST COUNTDOWN_n2_h1" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:24px;left:70px;">');
document.write('<image src="test countdown/t_46.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:83px;">');
document.write('<image src="test countdown/0.gif" name="TEST COUNTDOWN_n2_min2" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:93px;">');
document.write('<image src="test countdown/0.gif" name="TEST COUNTDOWN_n2_min1" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:24px;left:111px;">');
document.write('<image src="test countdown/t_46.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:124px;">');
document.write('<image src="test countdown/0.gif" name="TEST COUNTDOWN_n2_s2" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:134px;">');
document.write('<image src="test countdown/0.gif" name="TEST COUNTDOWN_n2_s1" align="top">');
document.write('</div>');
document.write('</div>');
TEST COUNTDOWN_to_date = new Date(2006,2,5,20,0,0);
bStopZero = 0;
function TEST COUNTDOWN_UpdatePanel()
{
 now = new Date;
 y=0; m=0; d=0; h=0; min=0; s=0;

 tmp_date = 0;
 to_date1 = TEST COUNTDOWN_to_date;
 if (now > to_date1)
  { tmp_date = now; now = to_date1; to_date1 = tmp_date; }

 x11 = now.getYear();
 x12 = now.getMonth();
 x13 = now.getDate();
 x14 = now.getHours();
 x15 = now.getMinutes();
 x16 = now.getSeconds();

 x21 = to_date1.getYear();
 x22 = to_date1.getMonth();
 x23 = to_date1.getDate();
 x24 = to_date1.getHours();
 x25 = to_date1.getMinutes();
 x26 = to_date1.getSeconds();

 if (x26 >= x16) s = x26 - x16;
 else {s = 60+x26-x16; x15 = x15+1; }
 if (x25 >= x15) min = x25 - x15;
 else { min = 60+x25-x15; x14 = x14+1; }
 if (x24 >= x14) h = x24 - x14;
 else { h = 24+x24-x14; x13 = x13+1; }
 if (x23 >= x13) d = x23-x13;
 else { d = GetDayCount(x11,x12) + x23-x13; x22 = x22-1; }
 if (x22 >= x12) m = x22-x12;
 else { m = 12+x22-x12; x11 = x11+1; }
 y = x21 - x11;

 fm = y*12 + m;
 msec = Date.parse(TEST COUNTDOWN_to_date) - Date.parse(now);
 fs = Math.floor(msec/1000);
 fmin = Math.floor(msec/(1000*60));
 fh = Math.floor(msec/(1000*60*60));
 fd = Math.floor(msec/(1000*60*60*24));
 fw = Math.floor(fd/7);
 dw = fd%7;
if (y+m+d+h+min+s == 0) ShowMessage("","");
if ((tmp_date != 0) && (bStopZero==1)) {y=0; m=0; d=0; h=0; min=0; s=0;}
sD = SetStrLength(d, 2, '0');
sH = SetStrLength(h, 2, '0');
sMIN = SetStrLength(min, 2, '0');
sS = SetStrLength(s, 2, '0');
TEST COUNTDOWN_SetVal(document.TEST COUNTDOWN_n2_d2, sD, 0);
TEST COUNTDOWN_SetVal(document.TEST COUNTDOWN_n2_d1, sD, 1);
TEST COUNTDOWN_SetVal(document.TEST COUNTDOWN_n2_h2, sH, 0);
TEST COUNTDOWN_SetVal(document.TEST COUNTDOWN_n2_h1, sH, 1);
TEST COUNTDOWN_SetVal(document.TEST COUNTDOWN_n2_min2, sMIN, 0);
TEST COUNTDOWN_SetVal(document.TEST COUNTDOWN_n2_min1, sMIN, 1);
TEST COUNTDOWN_SetVal(document.TEST COUNTDOWN_n2_s2, sS, 0);
TEST COUNTDOWN_SetVal(document.TEST COUNTDOWN_n2_s1, sS, 1);
setTimeout("TEST COUNTDOWN_UpdatePanel()",1000) }
TEST COUNTDOWN_UpdatePanel();
