function bookmarksite(){
	if (document.all)
		window.external.AddFavorite(top.location.href,top.document.title);
	else if (window.sidebar&&window.sidebar.addPanel)
		window.sidebar.addPanel(top.document.title, top.location.href, "");
	else
		alert(txt_ctrl_d);
}

function isNumeric(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }

function stripzero(num)
{
str=num+'';
if (str.length==2)
  {
	first=str.charAt(0);
	if (first=='0')
		str=str.substring(1);
  }
return str;
}

function calctime(s,m,h,d)
{
	clocklocation = document.getElementById('clock');

	if (s==0 && m==0 && h == 0 && d==0)
		{
		clocklocation.innerHTML = "<a href=''><font color='#EF4945'><B>Reload page</B></font></a>";
		}
	else
	{
		if (d>1)
			days = eval('d+" "+txt_days+", "');
		else if (d==1)
			days = eval('"1 "+txt_day+", "');
		else
			days = "";

		if (d==0 && h==0)
			hours = "";
		else if (h==1)
			hours = eval('"1 "+txt_hour+", "');
		else
			hours = eval('h+" "+txt_hours+", "');

		if (m==1)
			minutes = eval('"1 "+txt_minute+" "+txt_and+" "');
		else
			minutes = eval('m+" "+txt_minutes+" "+txt_and+" "');

		if (d==0 && h==0 && m==0) {
			clocklocation.innerHTML = "<font color='#EF4945'><B>"+txt_timetoturn+": "+s+" "+txt_seconds+"</B></font>"; }
		else {
			clocklocation.innerHTML = txt_timetoturn+": "+days+hours+minutes+s+" "+txt_seconds+"."; }

		rs=s-1;
		rm=m;
		rh=h;
		rd=d;

		if (rs==-1) {
			rs=59;
			rm=m-1;
			if (rm==-1) {
				rm=59;
				rh=h-1;
				if (rh==-1) {
					rh=23;
					rd=d-1;
				}
			}
		}

		setTimeout("calctime(rs,rm,rh,rd)", 1000);
	}
}

function timeleft(s,m,h,d)
{
	s=stripzero(s);
	m=stripzero(m);

	if (d === undefined)
	    d = 0;

	hEnd=9;

	sLeft=60-s;
	mLeft=59-m;

	if (h>=hEnd)
		hLeft=(24-h)+hEnd-1;
	else
		hLeft=hEnd-h-1;

	//dLeft=date-d;

	calctime(sLeft,mLeft,hLeft,d)
}