// -------------- //
// Calendar Debug //
// -------------- //

function cal_debug()
{
   document.writeln ("<br><br><hr><code><br>");

   document.writeln ("view_date\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+view_date+"<br>");
   document.writeln ("view_month\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+view_month+"<br>");
   document.writeln ("view_day\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+view_day+"<br>");
   document.writeln ("view_year\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+view_year+"<br>");
   document.writeln ("view_dow\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+view_dow+"<br>");
   document.writeln ("view_first_dow\&nbsp;\&nbsp;\&nbsp; = "+view_first_dow+"<br>");
   document.writeln ("view_month_str\&nbsp;\&nbsp;\&nbsp; = "+view_month_str+"<br><br>");

   document.writeln ("Month Array: stores info about each day in the Viewed month as 'wsmm':<br><br>");
   document.writeln ("\&nbsp; w  = Day of week (1-7)<br>");
   document.writeln ("\&nbsp; s  = Style number (0-5)<br>");
   document.writeln ("\&nbsp; mm = Day of month (1-31)<br><br>");
   document.writeln ("(0 means a missing day)<br><br>");
   for (i=0;i<=30;i++) {document.writeln ("\&nbsp;\&nbsp;\&nbsp;Month["+i+"] = "+Month[i]+"<br>");}

   document.writeln ("<br>First Thursday | First Friday<br>");
   document.writeln ("-----------------------------<br>");
   document.writeln ("first_thu\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+first_thu+"<br>");
   document.writeln ("first_thu_num\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+first_thu_num+"<br>");
   document.writeln ("first_fri\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+first_fri+"<br>");
   document.writeln ("first_fri_num\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+first_fri_num+"<br>");
   document.writeln ("first_thu_prior_month = "+first_thu_prior_month+"<br>");
   document.writeln ("cal_style\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+cal_style+"<br><br>");

   document.writeln ("Other Variables<br>");
   document.writeln ("---------------<br>");
   document.writeln ("leap_year = "+leap_year+"<br>");
   document.writeln ("dom\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+dom+"<br>");
   document.writeln ("dow\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+dow+"<br>");
   document.writeln ("view_first_dow = "+view_first_dow+"<br>");
   document.writeln ("tot_days\&nbsp; = "+tot_days+"<br><br>");

   document.writeln ("Calendar Table Display Variables<br>");
   document.writeln ("--------------------------------<br>");
   document.writeln ("first_row = "+first_row+"<br>");
   document.writeln ("new_row\&nbsp;\&nbsp; = "+new_row+"<br>");
   document.writeln ("last_row\&nbsp; = "+last_row+"<br>");
   document.writeln ("column\&nbsp;\&nbsp;\&nbsp; = "+column+"<br><br>");

   document.writeln ("Temporary Working Variables<br>");
   document.writeln ("---------------------------<br>");
   document.writeln (" temp\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+temp+"<br>");
   document.writeln (" temp_dow = "+temp_dow+"<br><br>");

   document.writeln ("Calendar Table Contents<br>");
   document.writeln ("-----------------------<br>");


   var c01=document.getElementById('cal').rows[01].cells[0].innerHTML

   var c02a=document.getElementById('cal').rows[02].cells[0].innerHTML
   var c02b=document.getElementById('cal').rows[02].cells[1].innerHTML
   var c02c=document.getElementById('cal').rows[02].cells[2].innerHTML
   var c02d=document.getElementById('cal').rows[02].cells[3].innerHTML
   var c02e=document.getElementById('cal').rows[02].cells[4].innerHTML
   var c02f=document.getElementById('cal').rows[02].cells[5].innerHTML
   var c02g=document.getElementById('cal').rows[02].cells[6].innerHTML

   var c03a=document.getElementById('cal').rows[03].cells[0].innerHTML
   var c03b=document.getElementById('cal').rows[03].cells[1].innerHTML
   var c03c=document.getElementById('cal').rows[03].cells[2].innerHTML
   var c03d=document.getElementById('cal').rows[03].cells[3].innerHTML
   var c03e=document.getElementById('cal').rows[03].cells[4].innerHTML
   var c03f=document.getElementById('cal').rows[03].cells[5].innerHTML
   var c03g=document.getElementById('cal').rows[03].cells[6].innerHTML

   var c04a=document.getElementById('cal').rows[04].cells[0].innerHTML
   var c04b=document.getElementById('cal').rows[04].cells[1].innerHTML
   var c04c=document.getElementById('cal').rows[04].cells[2].innerHTML
   var c04d=document.getElementById('cal').rows[04].cells[3].innerHTML
   var c04e=document.getElementById('cal').rows[04].cells[4].innerHTML
   var c04f=document.getElementById('cal').rows[04].cells[5].innerHTML
   var c04g=document.getElementById('cal').rows[04].cells[6].innerHTML

   var c05a=document.getElementById('cal').rows[05].cells[0].innerHTML
   var c05b=document.getElementById('cal').rows[05].cells[1].innerHTML
   var c05c=document.getElementById('cal').rows[05].cells[2].innerHTML
   var c05d=document.getElementById('cal').rows[05].cells[3].innerHTML
   var c05e=document.getElementById('cal').rows[05].cells[4].innerHTML
   var c05f=document.getElementById('cal').rows[05].cells[5].innerHTML
   var c05g=document.getElementById('cal').rows[05].cells[6].innerHTML

   var c06a=document.getElementById('cal').rows[06].cells[0].innerHTML
   var c06b=document.getElementById('cal').rows[06].cells[1].innerHTML
   var c06c=document.getElementById('cal').rows[06].cells[2].innerHTML
   var c06d=document.getElementById('cal').rows[06].cells[3].innerHTML
   var c06e=document.getElementById('cal').rows[06].cells[4].innerHTML
   var c06f=document.getElementById('cal').rows[06].cells[5].innerHTML
   var c06g=document.getElementById('cal').rows[06].cells[6].innerHTML

   var c07a=document.getElementById('cal').rows[07].cells[0].innerHTML
   var c07b=document.getElementById('cal').rows[07].cells[1].innerHTML
   var c07c=document.getElementById('cal').rows[07].cells[2].innerHTML
   var c07d=document.getElementById('cal').rows[07].cells[3].innerHTML
   var c07e=document.getElementById('cal').rows[07].cells[4].innerHTML
   var c07f=document.getElementById('cal').rows[07].cells[5].innerHTML
   var c07g=document.getElementById('cal').rows[07].cells[6].innerHTML

   var c08a=document.getElementById('cal').rows[08].cells[0].innerHTML
   var c08b=document.getElementById('cal').rows[08].cells[1].innerHTML
   var c08c=document.getElementById('cal').rows[08].cells[2].innerHTML
   var c08d=document.getElementById('cal').rows[08].cells[3].innerHTML
   var c08e=document.getElementById('cal').rows[08].cells[4].innerHTML
   var c08f=document.getElementById('cal').rows[08].cells[5].innerHTML
   var c08g=document.getElementById('cal').rows[08].cells[6].innerHTML

   var c09=document.getElementById('cal').rows[09].cells[0].innerHTML

   document.writeln("row01\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+c01+"<br>")
   document.writeln("row03\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+c02a+" | "+c02b+" | "+c02c+" | "+c02d+" | "+c02e+" | "+c02f+" | "+c02g+"<br>")
   document.writeln("row03\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+c03a+" | "+c03b+" | "+c03c+" | "+c03d+" | "+c03e+" | "+c03f+" | "+c03g+"<br>")
   document.writeln("row04\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+c04a+" | "+c04b+" | "+c04c+" | "+c04d+" | "+c04e+" | "+c04f+" | "+c04g+"<br>")
   document.writeln("row05\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+c05a+" | "+c05b+" | "+c05c+" | "+c05d+" | "+c05e+" | "+c05f+" | "+c05g+"<br>")
   document.writeln("row06\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+c06a+" | "+c06b+" | "+c06c+" | "+c06d+" | "+c06e+" | "+c06f+" | "+c06g+"<br>")
   document.writeln("row07\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+c07a+" | "+c07b+" | "+c07c+" | "+c07d+" | "+c07e+" | "+c07f+" | "+c07g+"<br>")
   document.writeln("row08\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+c08a+" | "+c08b+" | "+c08c+" | "+c08d+" | "+c08e+" | "+c08f+" | "+c08g+"<br>")
   document.writeln("row09\&nbsp;\&nbsp;\&nbsp;\&nbsp; = "+c09+"<br>")

   document.writeln ("</code>");
}

