<?xml version="1.0" encoding="utf-8"?>
<snippet xmlns="http://www.realmacsoftware.com/2007/Snippet/">
	<title>US-Calendar (update)</title>
	<content type="html">&lt;left&gt;
&lt;table border=&quot;0&quot;&gt;
    &lt;tr&gt;
      &lt;td&gt;&lt;script language = javascript&gt;
var now = new Date();

//----------------------------------------------------------------------------
// • Below you can change the names of the months (for instance in another language), and the bordercolour of the table. Default is white (#FFFFFF).

var month_array = new Array(&quot;January&quot;,&quot;February&quot;,&quot;March&quot;,&quot;April&quot;,&quot;May&quot;,&quot;June&quot;,&quot;July&quot;,&quot;August&quot;,&quot;September&quot;,&quot;October&quot;,&quot;November&quot;,&quot;December&quot;);
document.write(&quot;&lt;form name=date_list&gt;&lt;table bgcolor=#FFFFFF&gt;&lt;tr&gt;&lt;td&gt;&quot;);
document.write(&quot;&lt;select name=month onchange=change_month(this.options.selectedIndex)&gt;&quot;);
for(i=0;i&lt;month_array.length;i++)
{
if (now.getMonth() != i)
{document.write (&quot;&lt;option value=&quot;+i+&quot;&gt;&quot;+month_array[i]);}
else
{document.write (&quot;&lt;option value=&quot;+i+&quot; selected&gt;&quot;+month_array[i]);}

}
document.write(&quot;&lt;/select&gt;&quot;);
document.write(&quot;&lt;/td&gt;&lt;td&gt;&quot;);
document.write (&quot;&lt;select name=year onchange=change_year(this.options[this.options.selectedIndex])&gt;&quot;);
for(i=2000;i&lt;2100;i++)
{
if (now.getFullYear() != i)
{document.write(&quot;&lt;option value=&quot;+i+&quot;&gt;&quot;+i);}
else
{document.write(&quot;&lt;option value=&quot;+i+&quot; selected&gt;&quot;+i);}
}
document.write(&quot;&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=2&gt;&lt;center&gt;&quot;);

//----------------------------------------------------------------------------
// • Below you can change the backgroundcolour of the calendar (table bgcolor). Default is white (#FFFFFF).
// • Below you can change the backgroundcolour of the days (tr bgcolor). Default is white (#FFFFFF).
// • Below you can change the fontcolour of the days (font color). Default is grey (#d3d3d3).

// • The letters of the days are M, T, W, T, F, S and S, but you can change them, for instance in another language.

document.write(&quot;&lt;table bgcolor=#FFFFFF border=0 cellspacing = 0 cellpading = 0 width=100% &gt;&lt;tr bgcolor=#FFFFFF align=center&gt;&quot;);
document.write(&quot;&lt;td&gt;&lt;font color=#d3d3d3&gt;S&lt;/font&gt;&lt;/td&gt;&lt;td&gt;&lt;font color=#d3d3d3&gt;M&lt;/td&gt;&lt;td&gt;&lt;font color=#d3d3d3&gt;T&lt;/td&gt;&lt;td&gt;&lt;font color=#d3d3d3&gt;W&lt;/td&gt;&lt;td&gt;&lt;font color=#d3d3d3&gt;T&lt;/td&gt;&lt;td &gt;&lt;font color=#d3d3d3&gt;F&lt;/td&gt;&lt;td &gt;&lt;font color=#d3d3d3&gt;S&lt;/td&gt;&quot;);
document.write(&quot;&lt;/tr&gt;&lt;tr&gt;&quot;);
for(j=0;j&lt;6;j++)
{
for(i=0;i&lt;7;i++)
{
   document.write(&quot;&lt;td align=center&gt;&lt;div id=d&quot;+i+&quot;r&quot;+j+&quot;&gt;&lt;/div&gt;&lt;/td&gt;&quot;)
}
document.write(&quot;&lt;/tr&gt;&quot;);
}

document.write(&quot;&lt;/table&gt;&quot;);

document.write(&quot;&lt;/center&gt;&lt;/from&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;);

var show_date = new Date();

function set_cal(show_date)
{
begin_day = new Date (show_date.getFullYear(),show_date.getMonth());
begin_day_date = begin_day.getDay();
end_day = new Date (show_date.getFullYear(),show_date.getMonth()+1);
count_day = (end_day - begin_day)/1000/60/60/24;
if (begin_day.getMonth() == 2) count_day = 31;
else
if (begin_day.getMonth() == 9) count_day = 31;
input_table(begin_day_date,count_day);
}
set_cal(show_date);

function input_table(begin,count)
{
init();
j=0;
if (begin!=-1){i=begin-0;}else{i=6;}
for (c=1;c&lt;count+1;c++)
{
colum_name = &quot;d&quot;+i+&quot;r&quot;+j;
colum_name = document.getElementById(colum_name);
if ((now.getDate() == c)&amp;&amp;(show_date.getMonth() == now.getMonth())&amp;&amp;(show_date.getFullYear() == now.getFullYear()))

//----------------------------------------------------------------------------
// • Below you can change the backgroundcolour of the current day. Default is red (#FF0000).

{colum_name.style.backgroundColor = &quot;#FF0000&quot;;colum_name.style.color = &quot;&quot;;}
colum_name.innerHTML =  c;
i++;
if (i==7){i=0;j++;}
}
after_init();
}

function init()
{
for(j=0;j&lt;6;j++)
{
for(i=0;i&lt;7;i++)
{
colum_name = &quot;d&quot;+i+&quot;r&quot;+j;
colum_name = document.getElementById(colum_name);
colum_name.innerHTML =  &quot;-&quot;;
colum_name.style.backgroundColor =&quot;&quot;;

//----------------------------------------------------------------------------
// • Below you can change the fontcolour of the calendar (default is black #000000).

colum_name.style.color =&quot;#000000&quot;;
}
}
}

function after_init()
{
for(j=0;j&lt;6;j++)
{
for(i=0;i&lt;7;i++)
{
  colum_name = &quot;d&quot;+i+&quot;r&quot;+j;
colum_name = document.getElementById(colum_name);

//----------------------------------------------------------------------------
// • Below you can change the &quot;open days&quot; (default is -, but you can write • or * or whatever) and the fontcolour of it (default is white #FFFFFF, so it&apos;s not visible)

if (colum_name.innerHTML == &quot;-&quot;)
{
colum_name.style.color =&quot;#FFFFFF&quot;;
}
}
}
}

function change_month(sel_month)
{
show_date = new Date(show_date.getFullYear(),sel_month,1);
set_cal(show_date);
}

function change_year(sel_year)
{
sel_year = sel_year.value;
show_date = new Date(sel_year,show_date.getMonth(),1);
set_cal(show_date);
}
&lt;/script&gt;

      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
&lt;/left&gt;
</content>
</snippet>
