dig = new Image();
dig[0] = 'countdown/0.gif';
dig[1] = 'countdown/1.gif';
dig[2] = 'countdown/2.gif';
dig[3] = 'countdown/3.gif';
dig[4] = 'countdown/4.gif';
dig[5] = 'countdown/5.gif';
dig[6] = 'countdown/6.gif';
dig[7] = 'countdown/7.gif';
dig[8] = 'countdown/8.gif';
dig[9] = 'countdown/9.gif';
dig[10] = 'countdown/empty.gif';
dig[11] = '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 SetVal(Image, Str, Index)
{
 c = Str.charAt(Index);
 if (c==' ') c = '10';
 if (c=='-') c = '11';
 Image.src = 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:181px;height:54px;">');
document.write('<image src="countdown/bg.gif" align="top">');
document.write('<div style="position:absolute;top:0px;left:0px;width:181px;height:8px;">');
document.write('<image src="countdown/p0.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:8px;left:0px;width:181px;height:8px;">');
document.write('<image src="countdown/p1.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:1px;">');
document.write('<image src="countdown/0.gif" name="n2_y4" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:11px;">');
document.write('<image src="countdown/0.gif" name="n2_y3" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:21px;">');
document.write('<image src="countdown/0.gif" name="n2_y2" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:31px;">');
document.write('<image src="countdown/0.gif" name="n2_y1" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:20px;left:42px;">');
document.write('<image src="countdown/t_47.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:49px;">');
document.write('<image src="countdown/0.gif" name="n2_m2" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:59px;">');
document.write('<image src="countdown/0.gif" name="n2_m1" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:20px;left:70px;">');
document.write('<image src="countdown/t_47.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:77px;">');
document.write('<image src="countdown/0.gif" name="n2_d2" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:87px;">');
document.write('<image src="countdown/0.gif" name="n2_d1" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:105px;">');
document.write('<image src="countdown/0.gif" name="n2_h2" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:115px;">');
document.write('<image src="countdown/0.gif" name="n2_h1" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:20px;left:126px;">');
document.write('<image src="countdown/t_58.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:133px;">');
document.write('<image src="countdown/0.gif" name="n2_min2" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:143px;">');
document.write('<image src="countdown/0.gif" name="n2_min1" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:20px;left:154px;">');
document.write('<image src="countdown/t_58.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:161px;">');
document.write('<image src="countdown/0.gif" name="n2_s2" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:17px;left:171px;">');
document.write('<image src="countdown/0.gif" name="n2_s1" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:31px;left:0px;width:181px;height:8px;">');
document.write('<image src="countdown/p3.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:40px;left:121px;">');
document.write('<image src="countdown/0.gif" name="n4_fh6" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:40px;left:131px;">');
document.write('<image src="countdown/0.gif" name="n4_fh5" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:40px;left:141px;">');
document.write('<image src="countdown/0.gif" name="n4_fh4" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:40px;left:151px;">');
document.write('<image src="countdown/0.gif" name="n4_fh3" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:40px;left:161px;">');
document.write('<image src="countdown/0.gif" name="n4_fh2" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:40px;left:171px;">');
document.write('<image src="countdown/0.gif" name="n4_fh1" align="top">');
document.write('</div>');
document.write('</div>');
to_date = new Date(2007,0,1,0,0,0);
bStopZero = 0;
function UpdatePanel()
{
 now = new Date;
 y=0; m=0; d=0; h=0; min=0; s=0;

 tmp_date = 0;
 to_date1 = 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(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;}
sY = SetStrLength(y, 4, '0');
sM = SetStrLength(m, 2, '0');
sD = SetStrLength(d, 2, '0');
sH = SetStrLength(h, 2, '0');
sMIN = SetStrLength(min, 2, '0');
sS = SetStrLength(s, 2, '0');
sFH = SetStrLength(fh, 6, '0');
SetVal(document.n2_y4, sY, 0);
SetVal(document.n2_y3, sY, 1);
SetVal(document.n2_y2, sY, 2);
SetVal(document.n2_y1, sY, 3);
SetVal(document.n2_m2, sM, 0);
SetVal(document.n2_m1, sM, 1);
SetVal(document.n2_d2, sD, 0);
SetVal(document.n2_d1, sD, 1);
SetVal(document.n2_h2, sH, 0);
SetVal(document.n2_h1, sH, 1);
SetVal(document.n2_min2, sMIN, 0);
SetVal(document.n2_min1, sMIN, 1);
SetVal(document.n2_s2, sS, 0);
SetVal(document.n2_s1, sS, 1);
SetVal(document.n4_fh6, sFH, 0);
SetVal(document.n4_fh5, sFH, 1);
SetVal(document.n4_fh4, sFH, 2);
SetVal(document.n4_fh3, sFH, 3);
SetVal(document.n4_fh2, sFH, 4);
SetVal(document.n4_fh1, sFH, 5);
setTimeout("UpdatePanel()",1000) }
UpdatePanel();
