function ImageHide(objImage){
 if(document.getElementById(objImage))
 document.getElementById(objImage).style.display='none';
}

function ImageShow(objImage){
 if(document.getElementById(objImage))
 document.getElementById(objImage).style.display='';
}

function ShowHideImage(sID,sDigit)
{
 if (document.getElementById(sID+sDigit))
 {
  var disp = document.getElementById(sID+sDigit).style.display;
  if (disp=='') return;
 };

 var bShown = 0;
 for (i = 0; i <= 10; i++)
 {
  if (i==sDigit) {bShown=1; ImageShow(sID+i);} else ImageHide(sID+i);
 };
 if (bShown==0) ImageShow(sID+'10');
}

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 ccd_c_2010_SetVal(Image, Str, Index)
{
 c = Str.charAt(Index);
 if (c==' ') c = '10';
 if (c=='-') c = '11';
 if (Image.src != ccd_c_2010_dig[c]) Image.src = ccd_c_2010_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:135px;height:33px;">');
document.write('<image src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/border.gif" align="top">');
document.write('<div style="position:absolute;top:1px;left:1px;">');
document.write('<image src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/bg.gif" align="top">');
document.write('<div style="position:absolute;top:0px;left:0px;width:133px;height:8px;">');
document.write('<image src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/p0.gif" align="top">');
document.write('</div>');
document.write('<div style="position:absolute;top:8px;left:0px;width:133px;height:8px;">');
document.write('<image src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/p1.gif" align="top">');
document.write('</div>');
for (i = 0; i <= 9; i++) document.write('<div style="position:absolute;top:17px;left:1px;"><image style="display:none;" src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/'+i+'.gif" id="ccd_c_2010_n2_m2_'+i+'" align="top"></div>');
for (i = 0; i <= 9; i++) document.write('<div style="position:absolute;top:17px;left:11px;"><image style="display:none;" src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/'+i+'.gif" id="ccd_c_2010_n2_m1_'+i+'" align="top"></div>');
for (i = 0; i <= 9; i++) document.write('<div style="position:absolute;top:17px;left:29px;"><image style="display:none;" src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/'+i+'.gif" id="ccd_c_2010_n2_d2_'+i+'" align="top"></div>');
for (i = 0; i <= 9; i++) document.write('<div style="position:absolute;top:17px;left:39px;"><image style="display:none;" src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/'+i+'.gif" id="ccd_c_2010_n2_d1_'+i+'" align="top"></div>');
for (i = 0; i <= 9; i++) document.write('<div style="position:absolute;top:17px;left:57px;"><image style="display:none;" src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/'+i+'.gif" id="ccd_c_2010_n2_h2_'+i+'" align="top"></div>');
for (i = 0; i <= 9; i++) document.write('<div style="position:absolute;top:17px;left:67px;"><image style="display:none;" src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/'+i+'.gif" id="ccd_c_2010_n2_h1_'+i+'" align="top"></div>');
document.write('<div style="position:absolute;top:20px;left:78px;">');
document.write('<image src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/t_58.gif" align="top">');
document.write('</div>');
for (i = 0; i <= 9; i++) document.write('<div style="position:absolute;top:17px;left:85px;"><image style="display:none;" src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/'+i+'.gif" id="ccd_c_2010_n2_min2_'+i+'" align="top"></div>');
for (i = 0; i <= 9; i++) document.write('<div style="position:absolute;top:17px;left:95px;"><image style="display:none;" src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/'+i+'.gif" id="ccd_c_2010_n2_min1_'+i+'" align="top"></div>');
document.write('<div style="position:absolute;top:20px;left:106px;">');
document.write('<image src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/t_58.gif" align="top">');
document.write('</div>');
for (i = 0; i <= 9; i++) document.write('<div style="position:absolute;top:17px;left:113px;"><image style="display:none;" src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/'+i+'.gif" id="ccd_c_2010_n2_s2_'+i+'" align="top"></div>');
for (i = 0; i <= 9; i++) document.write('<div style="position:absolute;top:17px;left:123px;"><image style="display:none;" src="http://www.centralcoastdouble.com/counter/ccd_countdown_2010/'+i+'.gif" id="ccd_c_2010_n2_s1_'+i+'" align="top"></div>');
document.write('</div>');
document.write('</div>');
ccd_c_2010_to_date = new Date(2010,4,8,5,30,0);
bStopZero = 0;
function ccd_c_2010_UpdatePanel()
{
 now = new Date;
 y=0; m=0; d=0; h=0; min=0; s=0;

 tmp_date = 0;
 to_date1 = ccd_c_2010_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_date1) - 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;}
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');
ShowHideImage("ccd_c_2010_n2_m2_", sM.charAt(0));
ShowHideImage("ccd_c_2010_n2_m1_", sM.charAt(1));
ShowHideImage("ccd_c_2010_n2_d2_", sD.charAt(0));
ShowHideImage("ccd_c_2010_n2_d1_", sD.charAt(1));
ShowHideImage("ccd_c_2010_n2_h2_", sH.charAt(0));
ShowHideImage("ccd_c_2010_n2_h1_", sH.charAt(1));
ShowHideImage("ccd_c_2010_n2_min2_", sMIN.charAt(0));
ShowHideImage("ccd_c_2010_n2_min1_", sMIN.charAt(1));
ShowHideImage("ccd_c_2010_n2_s2_", sS.charAt(0));
ShowHideImage("ccd_c_2010_n2_s1_", sS.charAt(1));
setTimeout("ccd_c_2010_UpdatePanel()",1000) }
ccd_c_2010_UpdatePanel();
