function GlobalMenus(heading, path) 
{
	content = '';
//	content += '<center><font size="20" face="Arial, Helvetica, sans-serif" color="#FE4500"><b>GTCCC</b></font></center>';
	content += '<center><img src="' + path + 'images/new-logo.png"></center>';
	content += '<div align="center"><h1><font face="Arial, Helvetica, sans-serif">' + heading + '</font></h1></div>';
	content += '<center>';
	content += '<a href="' + path + 'index.html"><img src="' + path + 'images/home.gif" border="0"></a>';
	content += '<a href="' + path + 'memberclubs.html"><img src="' + path + 'images/memberclubs.gif" border="0"></a>';
	content += '<a href="' + path + 'interclub.html"><img src="' + path + 'images/competitions.gif" border="0"></a>';
	content += '<a href="' + path + 'gallery.html"><img src="' + path + 'images/gallery.gif" border="0"></a>';
	content += '<a href="' + path + 'executive.html"><img src="' + path + 'images/executive.gif" border="0"></a>';
//	content += '<a href="' + path + 'insurance.html"><img src="' + path + 'images/insurance.gif" border="0"></a>';
	content += '<a href="' + path + 'bb.html"><img src="' + path + 'images/bb.gif" border="0"></a>';
	content += '<a href="' + path + 'calendar.html"><img src="' + path + 'images/calendar.gif" border="0"></a>';
	content += '</center>';
	content += '<ul id="menu">';
//	content += '<li id="nav-1"><a href="' + path + 'index.html">Home</a></li>';
//	content += '<li id="nav-2"><a href="' + path + 'memberclubs.html">Member Clubs</a></li>';
	content += '<ul id="subnav-2">';
	content += '<li><a href="' + path + 'meetingplaces.html">Club Meeting Places</a></li>';
	content += '<li><a href="' + path + 'clubreps.html">Club Representatives</a></li>';			
	content += '</ul>';
//	content += '<li id="nav-3"><a href="' + path + 'interclub.html">Interclub Competitions</a></li>';
	content += '<ul id="subnav-3">';
	content += '<li><a href="interclub/2007/index.html">2007</a></li>';
	content += '<li><a href="interclub/2008/index.html">2008</a></li>';
	content += '</ul>';
//	content += '<li id="nav-4"><a href="' + path + 'executive.html">Executive</a></li>';
//	content += '<li id="nav-5"><a href="' + path + 'insurance.html">Insurance Plans</a></li>';
//	content += '<li id="nav-6"><a href="' + path + 'bb.html">Bulletin Board</a></li>';
	content += '</ul>';

	document.write(content);
}

function popCompetition(url, w, h, photog, title, ranking) 
{
	popw = + w + 120
	poph = + h + 150
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;

	if (title != "") {
		poph = + h + 180;
	}
	disp = window.open("","pop","height=" + poph + ",width=" + popw + ",left=0,top=0");
	content = '<HTML>';
	content += '</HEAD>';
	content += '<body bgcolor="#000000" text="#FFFFFF" link="#FFFFFF" vlink="#CCCCCC" alink="#006666" onBlur="self.close()">';
	content += '<FONT SIZE="2" FACE="arial,helvet">';
	content += '<CENTER>';
	content += '<table border="0" cellpadding="30" vspace="20" hspace="20" bordercolorlight="#000000" bordercolordark="#000000" bgcolor="#ffffff">';
	content += '<tr><td><center>';
	content += '<table align="center" background="' + url + '" border="0" cellpadding="0" cellspacing="0">';
	content += '<tr><td>';
	content += '<img src="images/sp.gif" width="' + w + '" height="' + h + '" border="0" align="middle">';
	content += '</td></tr>';
	content += '</table>';
	content += '</center></td></tr>';
	content += '</table>';
	if (title != "") {
		content += '<font face="Arial, Helvetica, sans-serif"><b><font color="#FFFFFF">&quot;' + title + '&quot; (' + ranking + ')</font><br><br>';
	}
	content += '<font face="Arial, Helvetica, sans-serif" size="-1" color="#CCCCCC">Photo by: </font>';
	content += '<font face="Arial, Helvetica, sans-serif"><b><font color="#FFFFFF">' + photog + '</font><br>';
	content += '<center>';
	content += '</BODY></HTML>';
	disp.document.write(content);
	disp.document.close();
}

function showCompetition(url, w, h, photog, title, rating) 
{
	thisTn = new Image();
	thisImg = new Image();
	img = 'interclub/2009/images/' + url + '.jpg';
	tn  = 'interclub/2009/thumbnails/' + url + '-TN.jpg';
	thisTn.src=tn;
	thisImg.src=img;
	thisImg.width = w;
	thisImg.height = h;
	thisTn.width = w/4;
	thisTn.height = h/4;
	if (thisTn.width < thisTn.height) thisTn.width = 150;
	content = '';
	content += '<td align="center"><font size="2" face="Arial, Helvetica, sans-serif">';
	if (url == '')
	{
		content += '<table align="center" border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse;background-repeat:no-repeat;">';
		content += '<tr><td>';
		content += '<table align="center" width="150" height="150" border="1" cellpadding="0" cellspacing="0" style="border-collapse:collapse;background-repeat:no-repeat;"><tr><td align="center" valign="middle">';
		content += '<b>Permission was not given for publication.</b>';
		content += '</td></tr></table>';
		content += '</td></tr>';
		content += '<tr><td>&nbsp;</td></tr>';
		content += '<tr><td align="center"><font size="2px" face="Arial, Helvetica, sans-serif"><b>' + title + '</b><br>' + photog + '<br><b>' + rating + '</b></font></td></tr>';
		content += '</table>';
	}
	else
	{
		content += '<table align="center" background="' + thisTn.src + '" border="0" cellpadding="0" cellspacing="0" style="background-repeat:no-repeat;">';
		content += '<tr><td>';
		content += '<A HREF="javascript:popCompetition(\'' + img + '\', \'' + thisImg.width + '\', \'' + thisImg.height + '\', \'' + photog + '\', \'' + title + '\', \'' + rating + '\')";><img src="images/sp.gif" width="' + thisTn.width + '" height="' + thisTn.height + '" border="0" align="middle"></a>';
		content += '</td></tr>';
		content += '<tr><td>&nbsp;</td></tr>';
		content += '<tr><td align="center"><font size="2px" face="Arial, Helvetica, sans-serif"><b>' + title + '</b><br>' + photog + '<br><b>' + rating + '</b></font></td></tr>';
		content += '</table>';
	}
	content += '</font></td>';
	document.write(content);
}

//
// From HHCC
//
var eventsArr=new Array(
'2009|	03|	01|	A|	<font color="yellow">PhotoArt 2009</font><br>Judging of Entries',
'2009|	03|	02|	A|	<font color="yellow">PhotoArt 2009</font><br>Hanging of images',
'2009|	03|	05|	A|	<font color="yellow">PhotoArt 2009</font><br>Opening',
'2009|	03|	09|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at Georgetown District High School.',
'2009|	03|	21|	A|	<font color="yellow">GTCCC Interclub 2009</font><br>Exhibition at TCC.',
'2009|	03|	22|	A|	<font color="yellow">March SMS</font><br>Royal Botanical Gardens.<br>Meet at Tim Hortons<br>(Mountainview North) @ 7:30 am',
'2009|	03|	29|	A|	<font color="yellow">Headwaters Art SHow & Sale</font><br>Alton Mill, Alton.<br>More <a href="events/090329.pdf" target="ext">Information</a><br>Noon to 5:00 pm',
'2009|	03|	24|	A|	<font color="yellow">8:00 pm to 10:00 pm</font><br>GTCCC meeting at TCC.',
'2009|	04|	08|	A|	<font color="yellow">7:00 pm<br>(Meet \'n Eat 6:00 pm)</font><br>HHCC Executive meeting.',
'2009|	04|	20|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at Georgetown District High School.<br>Spring In-Club Entries due.',
'2009|	05|	11|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at Georgetown District High School.',
'2009|	06|	08|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at Georgetown District High School.',
'2009|	09|	21|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at <br>Christ the King High School.',
'2009|	09|	21|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at <br>Christ the King High School.',
'2009|	10|	03|	A|	<font color="yellow">Photo Competition</font><br>"<a href="competitions.html#capture">Capture the Hills</a>"<br>Open to the Public',
'2009|	10|	04|	A|	<font color="yellow">Photo Competition</font><br>"<a href="competitions.html#capture">Capture the Hills</a>"<br>Open to the Public',
'2009|	10|	19|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at <br>Christ the King High School.<br><b><a href="javascript:jumpIfLoggedOn(\'member-competitions.html#GVIB\')">GVIB</a> images due.</b>',
'2009|	11|	09|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at <br>Christ the King High School.<br><b><a href="javascript:jumpIfLoggedOn(\'member-competitions.html#Inclub\')">Fall In-Club</a> images due.</b>',
'2009|	11|	15|	A|	<font color="yellow">Photo Competition</font><br>"<a href="javascript:jumpIfLoggedOn(\'member-competitions.html#GVIB\')">GVIB</a>" hosted by the Maitland Valley Camera Club.<br>Limited to club members only.',
'2009|	12|	14|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at <br>Christ the King High School.',
'2010|	01|	11|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at <br>Christ the King High School.',
'2010|	02|	08|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at <br>Christ the King High School.',
'2010|	03|	08|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at <br>Christ the King High School.',
'2010|	04|	12|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at <br>Christ the King High School.',
'2010|	05|	10|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at <br>Christ the King High School.',
'2010|	06|	14|	A|	<font color="yellow">7:30 pm to 9:30 pm</font><br>Monthly club meeting at <br>Christ the King High School.'
);

function PutCalendar()
{
	content = '';

// START OF CALENDAR
	content += '<td height="333" valign="middle">';
	content += '<center>';
	content += '<table border="0" width="200" cellspacing="0" cellpadding="0">';
	content += '<tr><td>&nbsp;</td></tr>';
	content += '<tr><td align="center" valign="middle">';
	content += '<div id="calendar-container"><script type="text/javascript">';
	content += 'function dateChanged(calendar) {';
	content += 'if (calendar.dateClicked) {';
	content += 'var y = calendar.date.getFullYear();';
	content += 'var m = calendar.date.getMonth();';
	content += 'var d = calendar.date.getDate();';
	content += 'document.getElementById(\'mainevent\').innerHTML=DateToEventEntry(y,m+1,d);';
	content += '}';
	content += '};';
	content += 'Calendar.setup(';
	content += '{';
	content += 'flat : "calendar-container",',
	content += 'flatCallback : dateChanged,';
	content += 'weekNumbers : false';
	content += '}';
	content += ');';
	content += '</script></div>';
	content += '</td></tr>';
	content += '<tr><td>&nbsp;</td></tr>';
	content += '<tr><td align="center" valign="middle" width="209" height="80"><div id="mainevent">';
	content += '&nbsp;';
	content += '</div></td></tr>';
	content += '</table>';
	content += '</center>';
	content += '</td>';
//	content += '<tr><td>&nbsp;</td></tr>';
// END OF CALENDAR

	document.write(content);
}

function DateToEvent(y,m,d)
{
	var n;
	var evnt=new Array('','');
	
	for (n = 0 ; n < eventsArr.length ; n++ )
	{
		var yy = word('|',1,eventsArr[n]);
		var mm = word('|',2,eventsArr[n]);
		var dd = word('|',3,eventsArr[n]);
		if ((y == yy) && (m == mm) && (d == dd))
		{
			evnt[0] = word('|',4,eventsArr[n]);
			evnt[1] = word('|',5,eventsArr[n]);
			break;
		}
	}
	return evnt;
}

function DateToEventType(y,m,d)
{
	var evntType='';

	evntType=DateToEvent(y,m,d)[0];	
	return evntType;
}

function DateToEventEntry(y,m,d)
{
	var evntEntry='';

	evntEntry=DateToEvent(y,m,d)[1];	
	return evntEntry;
}

function word(sep,which,inwhat)
{
	var n=0;
	var wstr='';
	var i=0;
	var s=0;
	var f=0;

	for (i=1 ; i < which ; i++)
	{
		n=inwhat.indexOf(sep,n);
		if (n < 0)
		{
			return '';
			break;
		}
		n++;
	}
	if ( n >= 0 )
	{
		s = n;
		f = inwhat.indexOf(sep,n);
		if (f < 0) f = inwhat.length;
		wstr = inwhat.substring(n,f);
	}
	return wstr;
}	

//	<script type="text/javascript" src="global.js"></script>
//	<script type="text/javascript" src="calendar/calendar.js"></script>
//	<script type="text/javascript" src="calendar/lang/calendar-en.js"></script>
//	<script type="text/javascript" src="calendar/calendar-setup.js"></script>
