function rad_set(rs0, rs1)
{
if (rs1 == 1)
 var my_target = '_self';
else
 var my_target = '_blank';
switch (rs0) {
 case 1:
  target1 = my_target;
  break;
 case 2:
  target2 = my_target;
  break;
 case 3:
  target3 = my_target;
  break;
 case 4:
  target4 = my_target;
  break;
 case 5:
  target5 = my_target;
  break;
 case 6:
  target6 = my_target;
  break;
 case 7:
  target7 = my_target;
  break;
 }
}
 
function AutoCur()
{
var today=new Date();
document.getElementById('autoTZ0').innerHTML="";
var znx = document.cur.tz.options.selectedIndex;
document.cur.tz.options[znx].selected = false;
document.cur.tz.options[znx0].selected = true;
document.cur.sel.value = "0";
my_year = today.getYear();
if (my_year < 1900)
 my_year += 1900;
document.getElementById('selTZ0').innerHTML=ZoneMsg2(document.cur, today.getTime(), my_year);
znx1 = znx0;
AutoAll();
}

function SelCur()
{
var today=new Date();
znx1 = document.cur.tz.options.selectedIndex;
document.getElementById('autoTZ0').innerHTML="<input type=button value='Auto' onclick='AutoCur()'>";
document.cur.sel.value = "1";
my_year = today.getYear();
if (my_year < 1900)
 my_year += 1900;
document.getElementById('selTZ0').innerHTML=ZoneMsg2(document.cur, today.getTime(), my_year);
AutoAll();
}

function AutoAll()
{
showCurtime();
AS1();
AS2();
AS5();
AS6();
AS7a();
AS7b();
}

function Auto1()
{
document.getElementById('autoTZ1').innerHTML="";
var znx = document.d1.tz.options.selectedIndex;
document.d1.tz.options[znx].selected = false;
document.d1.tz.options[znx1].selected = true;
document.d1.sel.value = "0";
ZM1();
}

function Sel1()
{
document.getElementById('autoTZ1').innerHTML="<input type=button value='Auto' onclick='Auto1()'>";
document.d1.sel.value = "1";
ZM1();
}

function ZM1()
{
document.getElementById('selTZ1').innerHTML=ZoneMsg1(document.d1);
}

function AS1()
{
if (document.d1.sel.value != '1')
  Auto1();
else
  Sel1();
}

function Auto2()
{
document.getElementById('autoTZ2').innerHTML="";
var znx = document.d2.tz.options.selectedIndex;
document.d2.tz.options[znx].selected = false;
document.d2.tz.options[znx1].selected = true;
document.d2.sel.value = "0";
ZM2();
}

function Sel2()
{
document.getElementById('autoTZ2').innerHTML="<input type=button value='Auto' onclick='Auto2()'>";
document.d2.sel.value = "1";
ZM2();
}

function ZM2()
{
document.getElementById('selTZ2').innerHTML=ZoneMsg1(document.d2);
}

function AS2()
{
if (document.d2.sel.value != '1')
  Auto2();
else
  Sel2();
}

function Auto5()
{
document.getElementById('autoTZ5').innerHTML="";
var znx = document.d5.tz.options.selectedIndex;
document.d5.tz.options[znx].selected = false;
document.d5.tz.options[znx1].selected = true;
document.d5.sel.value = "0";
ZM5();
}

function Sel5()
{
document.getElementById('autoTZ5').innerHTML="<input type=button value='Auto' onclick='Auto5()'>";
document.d5.sel.value = "1";
ZM5();
}

function ZM5()
{
document.getElementById('selTZ5').innerHTML=ZoneMsg1(document.d5);
}

function AS5()
{
if (document.d5.sel.value != '1')
  Auto5();
else
  Sel5();
}

function Auto6()
{
document.getElementById('autoTZ6').innerHTML="";
var znx = document.d6.tz.options.selectedIndex;
document.d6.tz.options[znx].selected = false;
document.d6.tz.options[znx1].selected = true;
document.d6.sel.value = "0";
ZM6();
}

function Sel6()
{
document.getElementById('autoTZ6').innerHTML="<input type=button value='Auto' onclick='Auto6()'>";
document.d6.sel.value = "1";
ZM6();
}

function ZM6()
{
document.getElementById('selTZ6').innerHTML=ZoneMsg1(document.d6);
}

function AS6()
{
if (document.d6.sel.value != '1')
  Auto6();
else
  Sel6();
}

function Auto7a()
{
document.getElementById('autoTZ7a').innerHTML="";
var znx = document.d7a.tz.options.selectedIndex;
document.d7a.tz.options[znx].selected = false;
document.d7a.tz.options[znx1].selected = true;
document.d7a.sel.value = "0";
ZM7a();
}

function Sel7a()
{
document.getElementById('autoTZ7a').innerHTML="<input type=button value='Auto' onclick='Auto7a()'>";
document.d7a.sel.value = "1";
ZM7a();
}

function ZM7a()
{
document.getElementById('selTZ7a').innerHTML=ZoneMsg1(document.d7a);
}

function AS7a()
{
if (document.d7a.sel.value != '1')
  Auto7a();
else
  Sel7a();
}

function Auto7b()
{
document.getElementById('autoTZ7b').innerHTML="";
var znx = document.d7b.tz.options.selectedIndex;
document.d7b.tz.options[znx].selected = false;
document.d7b.tz.options[znx1].selected = true;
document.d7b.sel.value = "0";
ZM7b();
}

function Sel7b()
{
document.getElementById('autoTZ7b').innerHTML="<input type=button value='Auto' onclick='Auto7b()'>";
document.d7b.sel.value = "1";
ZM7b();
}

function ZM7b()
{
document.getElementById('selTZ7b').innerHTML=ZoneMsg1(document.d7b);
}

function AS7b()
{
if (document.d7b.sel.value != '1')
  Auto7b();
else
  Sel7b();
}

function putTZselect(myfunc, myid)
{
document.write('<select name="tz" onChange="'+myfunc+'" id="'+myid+'">');
document.write('<option value="EDT(-4)">EDT(-4), Eastern Daylight<\/option>\n');
document.write('<option value="EST(-5)">EST(-5), Eastern Standard<\/option>\n');
document.write('<option value="CDT(-5)">CDT(-5), Central Daylight<\/option>\n');
document.write('<option value="CST(-6)">CST(-6), Central Standard<\/option>\n');
document.write('<option value="MDT(-6)">MDT(-6), Mountain Daylight<\/option>\n');
document.write('<option value="MST(-7)">MST(-7), Mountain Standard<\/option>\n');
document.write('<option value="PDT(-7)">PDT(-7), Pacific Daylight<\/option>\n');
document.write('<option value="PST(-8)">PST(-8), Pacific Standard<\/option>\n');
document.write('<option value="UTC(+0)">UTC(+0), Greenwich Mean Time<\/option>\n');
document.write('<option value="UTC+1">UTC+1 Rome <\/option>\n');
document.write('<option value="UTC+2">UTC+2 Istanbul<\/option>\n');
document.write('<option value="UTC+3">UTC+3 Moscow<\/option>\n');
document.write('<option value="UTC+4">UTC+4 Dubai<\/option>\n');
document.write('<option value="UTC+5">UTC+5<\/option>\n');
document.write('<option value="UTC+6">UTC+6<\/option>\n');
document.write('<option value="UTC+7">UTC+7 Bangkok<\/option>\n');
document.write('<option value="UTC+8">UTC+8 Manila<\/option>\n');
document.write('<option value="UTC+9">UTC+9 Tokyo<\/option>\n');
document.write('<option value="UTC+10">UTC+10 Brisbane<\/option>\n');
document.write('<option value="UTC+11">UTC+11<\/option>\n');
document.write('<option value="UTC+12">UTC+12<\/option>\n');
document.write('<option value="UTC-1">UTC-1<\/option>\n');
document.write('<option value="UTC-2">UTC-2<\/option>\n');
document.write('<option value="UTC-3">UTC-3 Buenos Aires<\/option>\n');
document.write('<option value="UTC-4">UTC-4<\/option>\n');
document.write('<option value="UTC-5">UTC-5<\/option>\n');
document.write('<option value="UTC-6">UTC-6<\/option>\n');
document.write('<option value="UTC-7">UTC-7<\/option>\n');
document.write('<option value="UTC-8">UTC-8<\/option>\n');
document.write('<option value="UTC-9">UTC-9 Anchorage<\/option>\n');
document.write('<option value="UTC-10">UTC-10 Honolulu<\/option>\n');
document.write('<option value="UTC-11">UTC-11<\/option>\n');
document.write('<option value="UTC-12">UTC-12<\/option>\n');
document.write('<\/select>');
//document.write('<div style="position:absolute;left:0px;top:0px;"><input type="text" name="sel" size="1" maxlength="1" value="0"><\/div>');
document.write('<input type="hidden" name="sel" size="1" maxlength="1" value="0">');
if (myid == 'TZ1' || myid == 'TZ2')
 {
 document.write('<td id=\"');
 document.write('sel'+myid+'\"');
 document.write('></td><td id=\"');
 document.write('auto'+myid+'\"');
 document.write('></td>');
 }
}

function CalcButtons(i)
{
if (ReliableBrowser == "Yes")
 {
 document.write("Do calculation in:<br>");
 document.write("<input type='radio' name='dest"+i+"' value='new' checked onClick='rad_set("+i+",0)'>New window<\/input>&nbsp;");
 document.write("<input type='radio' name='dest"+i+"' value='this' onClick='rad_set("+i+",1)'>This window<\/input>&nbsp;");
 }
document.write("&nbsp;<input type=submit value='Calculate'> <input type=button value='e.g.' onClick='Eg"+i+"()'> <input type=button value='Clear' onClick='Clear"+i+"()'>");
}

function padNum(i)
{
if (i < 10)
 i="0"+i;
return i;
}

function padDigits(i)
{
var j = 1;
j *= i;
i = j;
if (i < 10)
 i = "0" + i;
return i; 
}

function RandName()
{
var i = Math.floor(Math.random()*30) + 1;
switch (i)
  {
   case (30):
    return ("Emil");
   case (29):
    return ("Prudence");
   case (28):
    return ("Priscilla");
   case (27):
    return ("Isidore");
   case (26):
    return ("Percival");
   case (25):
    return ("Chauncey");
   case (24):
    return ("Nadine");
   case (23):
    return ("Lolita");
   case (22):
    return ("Imogene");
   case (21):
    return ("Hedwig");
   case (20):
    return ("Drusilla");
   case (19):
    return ("Daphne");
   case (18):
    return ("Aurelia");
   case (17):
    return ("Montague");
   case (16):
    return ("Thurston");
   case (15):
    return ("Ichabod");
   case (14):
    return ("Winifred");
   case (13):
    return ("Ebenezer");
   case (12):
    return ("Abner");
   case (11):
    return ("Mortimer");
   case (10):
    return ("Bertha");
   case (9):
    return ("Daisy Mae");
   case (8):
    return ("Clyde");
   case (7):
    return ("Abigail");
   case (6):
    return ("Penelope");
   case (5):
    return ("Sylvester");
   case (4):
    return ("Bartholomew");
   case (3):
    return ("John");
   case (2):
    return ("Mary");
   case (1):
    return ("Jezebel");
   default:
    return ("Bob");
  }
}

function ZoneDesc(myform)
{
var znx=myform.tz.options.selectedIndex;
return(myform.tz.options[znx].value);
}

var BrIErr = "Inaccurate or obsolete javascript interpreter. (HINT: Internet Explorer does not honor normal javascript standards. Try a non-Microsoft browser such as Firefox or Opera.) Read the Browser / javascript notes for more."

function sendform1()
{
if (BrowserTest != "_")
 {
 alert(BrIErr);
 return;
 }
document.getElementById('err1').innerHTML="&nbsp;";
if (errMsg = validDate(document.d1))
 {
 document.getElementById('err1').innerHTML="<p class=err>Invalid or missing "+errMsg+" value; correct and resubmit.<\/p>";
 return;
 }
ZM1();
zstr1 = ZoneDesc(document.d1);
zstr2 = ZoneDesc(document.cur);
var sendurl = "s1/seccalc1.html?wnd="+target1+"&m="+document.d1.m.value+"&d="+document.d1.d.value+"&y="+document.d1.y.value+"&h="+document.d1.h.value+"&i="+document.d1.i.value+"&s="+document.d1.s.value+"&z1="+zstr1+"&zv1="+tzVal(document.d1.tz.value)+"&z2="+zstr2+"&zv2="+tzVal(document.cur.tz.value);
if (document.d1.title1.value > "                               ")
 {sendurl = sendurl+"&title="+document.d1.title1.value;}
window.open(sendurl,target1,'width=760,height=360');
}

function sendform2()
{
if (BrowserTest != "_")
 {
 alert(BrIErr);
 return;
 }
document.getElementById('err2').innerHTML="&nbsp;";
if (errMsg = validDate(document.d2))
 {
 document.getElementById('err2').innerHTML="<p class=err>Invalid or missing "+errMsg+" value; correct and resubmit.<\/p>";
 return;
 }
ZM2();
zstr1 = ZoneDesc(document.d2);
zstr2 = ZoneDesc(document.cur);
var sendurl = "s1/seccalc2.html?wnd="+target2+"&m="+document.d2.m.value+"&d="+document.d2.d.value+"&y="+document.d2.y.value+"&h="+document.d2.h.value+"&i="+document.d2.i.value+"&s="+document.d2.s.value+"&z1="+zstr1+"&zv1="+tzVal(document.d2.tz.value)+"&z2="+zstr2+"&zv2="+tzVal(document.cur.tz.value);
if (document.d2.title2.value > "                               ")
 {sendurl = sendurl+"&title="+document.d2.title2.value;}
window.open(sendurl,target2,'width=760,height=360');
}

function sendform3()
{
if (BrowserTest != "_")
 {
 alert(BrIErr);
 return;
 }
document.getElementById('err3').innerHTML="&nbsp;";
if (chkNum(document.d3.s.value,12) > 0 || document.d3.s.value == "")
 {
 document.getElementById('err3').innerHTML="<p class=err>Invalid or missing seconds value; correct and resubmit.<\/p>";
 return;
 }
document.d3.s.value = normalizeNum(document.d3.s.value);
if (document.d3.s.value > max_sec3)
 {
 document.getElementById('err3').innerHTML="<p class=err>Seconds value is too big (can't compute that far back in the past)<\/p>";
 return;
 }
zstr1 = ZoneDesc(document.cur);
var sendurl = "s1/seccalc3.html?wnd="+target3+"&s="+document.d3.s.value+"&z1="+zstr1+"&zv1="+tzVal(document.cur.tz.value);
if (document.d3.title3.value > "                               ")
 {sendurl = sendurl+"&title="+document.d3.title3.value;}
window.open(sendurl,target3,'width=760,height=360');
}

function sendform4()
{
if (BrowserTest != "_")
 {
 alert(BrIErr);
 return;
 }
document.getElementById('err4').innerHTML="&nbsp;";
if (chkNum(document.d4.s.value,12) > 0 || document.d4.s.value == "")
 {
 document.getElementById('err4').innerHTML="<p class=err>Invalid or missing seconds value; correct and resubmit.<\/p>";
 return;
 }
document.d4.s.value = normalizeNum(document.d4.s.value);
zstr1 = ZoneDesc(document.cur);
var sendurl = "s1/seccalc4.html?wnd="+target4+"&s="+document.d4.s.value+"&z1="+zstr1+"&zv1="+tzVal(document.cur.tz.value);
if (document.d4.title4.value > "                               ")
 {sendurl = sendurl+"&title="+document.d4.title4.value;}
window.open(sendurl,target4,'width=760,height=360');
}

function sendform5()
{
if (BrowserTest != "_")
 {
 alert(BrIErr);
 return;
 }
document.getElementById('err5').innerHTML="&nbsp;";
var myerr=0;
if (errMsg = validDate(document.d5))
 myerr = 1;
else
 { 
 if (chkNum(document.d5.sec.value,12) > 0 || document.d5.sec.value == "")
  {
  myerr = 1;
  document.d5.sec.focus();
  errMsg = "interval seconds";
  }
 }
if (myerr > 0)
 {
 document.getElementById('err5').innerHTML="<p class=err>Invalid or missing "+errMsg+" value; correct and resubmit.<\/p>";
 return;
 }
document.d5.sec.value = normalizeNum(document.d5.sec.value);
ZM5();
zstr1 = ZoneDesc(document.d5);
var sendurl = "s1/seccalc5.html?wnd="+target5+"&m="+document.d5.m.value+"&d="+document.d5.d.value+"&y="+document.d5.y.value+"&h="+document.d5.h.value+"&i="+document.d5.i.value+"&s="+document.d5.s.value+"&z1="+zstr1+"&zv1="+tzVal(document.d5.tz.value)+"&sec="+document.d5.sec.value;
if (document.d5.title5.value > "                               ")
 {sendurl = sendurl+"&title="+document.d5.title5.value;}
window.open(sendurl,target5,'width=760,height=360');
}

function sendform6()
{
if (BrowserTest != "_")
 {
 alert(BrIErr);
 return;
 }
document.getElementById('err6').innerHTML="&nbsp;";
var myerr=0;
if (errMsg = validDate(document.d6))
 myerr = 1;
else
 { 
 if (chkNum(document.d6.sec.value,12) > 0 || document.d6.sec.value == "")
  {
  myerr = 1;
  document.d6.sec.focus();
  errMsg = "interval seconds";
  }
 }
if (myerr > 0)
 {
 document.getElementById('err6').innerHTML="<p class=err>Invalid or missing "+errMsg+" value; correct and resubmit.<\/p>";
 return;
 }
document.d6.sec.value = normalizeNum(document.d6.sec.value);
ZM6();
zstr1 = ZoneDesc(document.d6);
var sendurl = "s1/seccalc6.html?wnd="+target6+"&m="+document.d6.m.value+"&d="+document.d6.d.value+"&y="+document.d6.y.value+"&h="+document.d6.h.value+"&i="+document.d6.i.value+"&s="+document.d6.s.value+"&z1="+zstr1+"&zv1="+tzVal(document.d6.tz.value)+"&sec="+document.d6.sec.value;
if (document.d6.title6.value > "                               ")
 {sendurl = sendurl+"&title="+document.d6.title6.value;}
window.open(sendurl,target6,'width=760,height=360');
}

function sendform7()
{
if (BrowserTest != "_")
 {
 alert(BrIErr);
 return;
 }
document.getElementById('err7a').innerHTML="&nbsp;";
document.getElementById('err7b').innerHTML="&nbsp;";
if (errMsg = validDate(document.d7a))
 {
 document.getElementById('err7a').innerHTML="<p class=err>Invalid or missing "+errMsg+" value; correct and resubmit.<\/p>";
 return;
 }
if (errMsg = validDate(document.d7b))
 {
 document.getElementById('err7b').innerHTML="<p class=err>Invalid or missing "+errMsg+" value; correct and resubmit.<\/p>";
 return;
 }
ZM7a();
ZM7b();
zstr1 = ZoneDesc(document.d7a);
zstr2 = ZoneDesc(document.d7b);
var sendurl = "s1/seccalc7.html?wnd="+target7+"&m1="+document.d7a.m.value+"&d1="+document.d7a.d.value+"&y1="+document.d7a.y.value+"&h1="+document.d7a.h.value+"&i1="+document.d7a.i.value+"&s1="+document.d7a.s.value+"&z1="+zstr1+"&zv1="+tzVal(document.d7a.tz.value)+"&m2="+document.d7b.m.value+"&d2="+document.d7b.d.value+"&y2="+document.d7b.y.value+"&h2="+document.d7b.h.value+"&i2="+document.d7b.i.value+"&s2="+document.d7b.s.value+"&z2="+zstr2+"&zv2="+tzVal(document.d7b.tz.value);
if (document.d7b.title7.value > "                               ")
 {sendurl = sendurl+"&title="+document.d7b.title7.value;}
window.open(sendurl,target7,'width=760,height=360');
}

function normalizeNum(i)
{
var myNum=1;
myNum*=i;
return myNum;
}

function tzVal(tzStr)
// Extract the offset hours value from the timezone label
{
if (tzStr.charAt(3) == '(')
  return (tzStr.substring(4,tzStr.length-1));
else
  return (tzStr.substring(3,tzStr.length));
}

function chkNum(field,digits)
{
var ii=1;
ii *= field;
if (ii != field)
 return(1);
return(0); 
}

function validDate(myform)
{
if (chkNum(myform.m.value,2) > 0)
 {
 myform.m.focus();
 return("month");
 }
myform.m.value = padDigits(myform.m.value);
if (myform.m.value > 12 || myform.m.value < 1)
 {
 myform.m.focus();
 return("month");
 }
if (chkNum(myform.d.value,2) > 0)
 {
 myform.d.focus();
 return("day");
 }
myform.d.value = padDigits(myform.d.value);
if (myform.d.value > 31 || myform.d.value < 1)
 {
 myform.d.focus();
 return("day");
 }
if (chkNum(myform.y.value,4) > 0)
 {
 myform.y.focus();
 return("year")
 }
// Try to make sense out of year with 1 or 2 or 3 digits 
var yearval=1;
yearval*=myform.y.value;
if (yearval <= 0)
 {
 myform.y.focus();
 return("year")
 }
if (myform.y.value < 100)
 {
 if (myform.y.value < 10)
  {myform.y.value = 2000 + yearval;}
 else
  {myform.y.value = 1900 + yearval;}
 }
if (myform.y.value < 1000)
 {
 myform.y.value = yearval;
 myform.y.value = "0"+myform.y.value;
 }
// MM/DD/YYYY are OK so far; check for days-per-month violation
if (myform.d.value > 30)
 {
 if (myform.m.value == 4 || myform.m.value == 6 || myform.m.value == 9 || myform.m.value == 11)
  {
  myform.d.focus();
  return("day");
  }
 }
if (myform.m.value == 2)
 {
 if (myform.d.value > 29)
  {
  myform.d.focus();
  return("day");
  }
 if (myform.d.value > 28)
  {
  if ((myform.y.value % 4) != 0)
   {
   myform.d.focus();
   return("day");
   }
  if ((myform.y.value % 100) == 0)
   {
   if ((myform.y.value % 400) != 0)
    {
    myform.d.focus();
    return("day");
    }
   }
  }
 }
if (chkNum(myform.h.value,2) > 0)
 {
 myform.h.focus();
 return("hour");
 }
myform.h.value = padDigits(myform.h.value);
if (myform.h.value > 23)
 {
 myform.h.focus();
 return("hour");
 }
if (chkNum(myform.i.value,2) > 0)
 {
 myform.i.focus();
 return("minute");
 }
myform.i.value = padDigits(myform.i.value);
if (myform.i.value > 59)
 {
 myform.i.focus();
 return("minute");
 }
if (chkNum(myform.s.value,2) > 0)
 {
 myform.s.focus();
 return("seconds")
 }
myform.s.value = padDigits(myform.s.value);
if (myform.s.value > 59)
 {
 myform.s.focus();
 return("seconds");
 }
return("");
}

function showCurtime()
{
var today=new Date();
d=today.getDay();
dstr1="";
switch (d)
 {
 case 0:
  dstr1="Sun";
  break;
 case 1:
  dstr1="Mon";
  break;
 case 2:
  dstr1="Tue";
  break;
 case 3:
  dstr1="Wed";
  break;
 case 4:
  dstr1="Thu";
  break;
 case 5:
  dstr1="Fri";
  break;
 case 6:
  dstr1="Sat";
  break;
 }
dstr1=dstr1+".&nbsp;"
m=today.getMonth();
switch (m)
 {
 case 0:
  dstr1=dstr1+"Jan.";
  break;
 case 1:
  dstr1=dstr1+"Feb.";
  break;
 case 2:
  dstr1=dstr1+"March";
  break;
 case 3:
  dstr1=dstr1+"April";
  break;
 case 4:
  dstr1=dstr1+"May";
  break;
 case 5:
  dstr1=dstr1+"Jun";
  break;
 case 6:
  dstr1=dstr1+"July";
  break;
 case 7:
  dstr1=dstr1+"Aug.";
  break;
 case 8:
  dstr1=dstr1+"Sep.";
  break;
 case 9:
  dstr1=dstr1+"Oct.";
  break;
 case 10:
  dstr1=dstr1+"Nov.";
  break;
 case 11:
  dstr1=dstr1+"Dec.";
  break;
 }

d=today.getDate()
yy=today.getYear();
if (yy < 1900)
 yy += 1900;
h=today.getHours()
i=today.getMinutes()
s=today.getSeconds()
d=padNum(d);
h=padNum(h);
i=padNum(i);
s=padNum(s);

dstr1=dstr1+"&nbsp;"+d+",&nbsp;"+yy+"&nbsp;&nbsp;"+h+":"+i+":"+s;
//dstr1 = today.toString();
//dstr1 = dstr1.substring(0,dstr1.length-5);
var my_nx = document.cur.tz.options.selectedIndex;
var zstr1 = " ????";
if (my_nx < 33)
 {
 zstr1 = document.cur.tz.options[my_nx].text;
 if (my_nx < 9)
  zstr1 = zstr1.substring(0,7);
 else
  {
  if (zstr1.length > 6)
   zstr1 = zstr1.substring(0,6);
  }
 dstr1 = dstr1+"&nbsp;&nbsp;"+zstr1; 
 }
document.getElementById('CurTime').innerHTML="<p class='reg'><span class='regr'>"+dstr1+"<\/span><\/p>";
}

function BlankErr()
{
document.getElementById('err1').innerHTML="&nbsp;";
document.getElementById('err2').innerHTML="&nbsp;";
document.getElementById('err3').innerHTML="&nbsp;";
document.getElementById('err4').innerHTML="&nbsp;";
document.getElementById('err5').innerHTML="&nbsp;";
document.getElementById('err6').innerHTML="&nbsp;";
document.getElementById('err7a').innerHTML="&nbsp;";
document.getElementById('err7b').innerHTML="&nbsp;";
if (ReliableBrowser == 'No')
 alert(BrIErr);
}

function ZoneMsg1(myform)
{
var parm2
if (myform.y.value > 0 && myform.m.value > 0 && myform.d.value > 0)
 {
 var wk_year = 1;
 wk_year *= myform.y.value;
 if (wk_year < 100)
  {
  if (wk_year < 10)
   wk_year += 2000;
  else
   wk_year += 1900;
  }
 var mytime=new Date(wk_year, myform.m.value-1, myform.d.value, myform.h.value, 0, 0);
 var parm2 = mytime.getTime();
 var parm3 = wk_year;
 }
else
 {
 var parm2 = 0;
 var parm3 = 0;
 }
return ZoneMsg2(myform, parm2, parm3);
}

function ZoneMsg2(myform, my_msec, my_year)
{
var mytext1 = "<span class=zone>&nbsp;(";
var mytext2 = "";
var mysel=myform.sel.value;
var znx = myform.tz.options.selectedIndex;
if (znx < 8 && my_msec != 0 && my_year != 0)
 {
 var ds = IsDaylightSaving(my_msec, my_year);
 if (ds == 1)
  {
  if (znx == 1 || znx == 3 || znx == 5 || znx == 7)
   {
   if (mysel != "1")
    {
    myform.tz.options[znx].selected = false;
    znx--;
    myform.tz.options[znx].selected = true;
    }
   else
    mytext2 = "s/b Daylight Saving";
   }
  }
 else
  {
  if (ds == 0)
   {
   if (znx == 0 || znx == 2 || znx == 4 || znx == 6)
    {
    if (mysel != "1")
     {
     myform.tz.options[znx].selected = false;
     znx++;
     myform.tz.options[znx].selected = true;
     }
    else
     mytext2 = "s/b Standard time";
    }
   }
  }
 }
 if (mytext2 == "")
  {
  if (mysel != "1")
   mytext2 = "Auto selected";
  else
   mytext2 = "You selected";
  }
 mytext1 = mytext1+mytext2+")&nbsp;<\/span><\/p>";
 return mytext1; 
}
