/* 	
#####################################################################################

	AUTHOR: Katrina Edgar
	
	NAVIGATION FUNCTIONS
	
	The following functions populate the orange navigation bar located directly
	under the header on each page
#####################################################################################
*/
	 	
	/* Write the home page link in the orange navigation bar */
	function openNavigation () {
	}
	
	/* Close off the orange navigation bar */
	function closeNavigation () {
	}
	
	/* Write the navigation bar for the home page */
	function writeHomeNavigation() {
	}
	
	/* 	Write the navigation for the pages linked to from the home page
		-> Clubs
		-> Conference
		-> District
		-> Resources
		-> ASTRA
		-> Contact Us */
	function writeNavigation(pagename) {
	}
	
	/* Write the navigation for clubs */
	function writeClubNavigation(clubname) {
	}
	
	/* Write the navigation for conference information */
	function writeConferenceNavigation(conference) {
	}
	
	/* Write the navigation for district information */
	function writeDistrictNavigation(district) {
	}
	
	/* Write the navigation for resources */
	function writeResourceNavigation(resource) {
	}
	
/* END OF NAVIGATION FUNCTIONS */


/* 	
#####################################################################################
	CLUB FUNCTIONS
	
	The following functions populate the left hand panel of the clubs screen,
	with information on the club board, meeting details, contact information and
	a photo of the current president.
#####################################################################################
*/
	
	/*	To write a piece of information about the club */
	function writeClubInformation(heading, content) {
		
		document.write('<tr><td><h1>'+heading+'</h1></td></tr>');
		document.write('<tr><td><h2>'+content+'</h2></td></tr>');
	}
	
	/* To write the email contact information for the club president */
	function writeClubContact(email) {
		
		document.write('<tr><td><font style=\"color: #DEA321;font-size:12px;font-weight:bold;text-transform:uppercase;line-height:16px;\">');
		document.write('<a href=\"mailto:president.'+email+'@altrusa.org.nz\">');
		document.write('<img src=\"images/email.gif\" title=\"president.'+email+'@altrusa.org.nz\" align=\"right\" border=\"0\" style=\"text-decoration:none;padding-top:5px;\">');
		document.write('</a><br>Contact Us</font><br clear=\"all\"></td></tr>');
	}
	
	/* To write the president's photo, with caption */
	function writePresidentPhoto(clubname,president) {
		
		document.write('<tr><td style=\"text-align:center;padding-top:5px;\">');
		document.write('<img src=\"images/clubs/president_'+clubname+'.jpg\" title=\"'+president+'\"  alt=\"'+president+'\"></td></tr>');
		document.write('<tr><td style=\"text-align:center;font-size:8pt">'+president+'</td></tr>');
	}
/* END OF CLUB FUNCTIONS */

/* 	
#####################################################################################
	DISTRICT FUNCTIONS
	
	The following functions populate the district pages
	with board information, photos, visit information & governor goals
#####################################################################################
*/
	
	/* Write board information (president, secretary, treasurer, etc.) */
	function writeBoardInformation(heading,content) {
		
		writeClubInformation(heading,content);
	}
	
	/* Write visit information for district representatives */
	function writeVisitInformation(visitdate,clubs) {
		
		document.write('<tr><td><h4>'+visitdate+'</h4></td></tr>');
		document.write('<tr><td><h2>'+clubs+'</h2></td></tr>');
	}
	
	/* Write a photo to the left hand column of the screen */
	function writePhoto(photoname,photocaption) {
		
		document.write('<tr><td style=\"text-align:center;padding-top:5px;\"><img src=\"'+photoname+'\" title=\"'+photocaption.replace(/<br>/g," ")+'\" alt=\"'+photocaption.replace(/<br>/g," ")+'\"></td></tr>');
		document.write('<tr><td style=\"text-align:center;font-size:8pt">'+photocaption+'</td></tr>');
	}
	
	/* Write category information for governor goals */
	function writeGovernorGoalCategory (categoryname) {
		
		document.write('<tr><td colspan=\"2\" style="width:570px"><h1>'+categoryname+'</h1></td></tr>');
	}
	
	/* Write the content of a governor goal, including whether or not it has been achieved */
	function writeGovernorGoal (goal, achievement) {
		
		document.write('<tr><td style=\"width:430px\">'+goal+'</td><td style=\"width=140px\";>'+achievement+'</td></tr>');
	}
/* END OF DISTRICT FUNCTIONS */

/* 	
#####################################################################################
	RESOURCE FUNCTIONS
	
	The following functions populate the left hand panel of the resources screen,
	with headings and links to documents for download.
	There is also a specific set of functions to render the table of awards.
#####################################################################################
*/

	/* Write an orange heading for downloadable resources */
	function writeResourceHeading(heading) {
		
		document.write('<tr><td colspan=\"2\"><h1>'+heading+'</h1></td></tr>');
	}
	
	/* 	Write a resource link for a document that can be downloaded
		The document may be a PDF, word document or publisher document
		The resource link will include an icon to inform the user of the type of document
		It also includes the title of the resource and a link to download the content
		
		This function is used outside the resources screen for downloadable content
		such as club brochures and conference registration forms */
	function writeResourceLink(doctype,doclink,docname) {
			
		document.write('<tr><td style=\"border:none;\"><h3>');
		
		if (doctype == "word") {
			document.write('<img src=\"images/word.gif\">');
		}
		else if (doctype == "pdf") {
			document.write('<img src=\"images/pdf.gif\">');
			
		}
		else if (doctype == "pub") {
			document.write('<img src=\"images/publisher.gif\">');
			
		}
		else {
			
		}
		
		document.write('</h3></td>');
		document.write('<td style=\"border:none;\"><a href=\"'+doclink+'\" title=\"'+docname+'\"><h3>'+docname+'</h3></a></td></tr>');
	}
	
	/* Write the heading information for the awards table */
	function writeAwardHeading (award, sendto, closedate, description) {
		
		document.write('<tr style=\"width:800px;\">');
		document.write('<td style=\"width:160px;\"><h4>'+award+'</h4></td>');
		document.write('<td style=\"width:200px;\"><h4>'+sendto+'</h4></td>');
		document.write('<td style=\"width:120px;\"><h4>'+closedate+'</h4></td>');
		document.write('<td style=\"width:320px;\"><h4>'+description+'</h4></td></tr>');
	}
	
	/* Write the details of an award */
	function writeAward (award, sendto, closedate, description) {
		
		document.write('<tr style=\"width:800px;\">');
		document.write('<td style=\"width:160px;\">'+award+'</td>');
		document.write('<td style=\"width:200px;\">'+sendto+'</td>');
		document.write('<td style=\"width:120px;\">'+closedate+'</td>');
		document.write('<td style=\"width:320px;\">'+description+'</td></tr>');
	}
/* END OF RESOURCE FUNCTIONS */

/* 	
#####################################################################################
	CONTACT FUNCTIONS
	
	The following functions populate club contact information on the Contact Us page
#####################################################################################
*/
	
	/* 	Write a link to the club information and the contact email details for the president */
	function writeContact(email) {
		
		document.write('<tr><td style="width:210px"><font style=\"color: #DEA321;font-size:12px;font-weight:bold;text-transform:uppercase;line-height:16px;\">');
		document.write('<a href=\"mailto:president.'+email+'@altrusa.org.nz\">');
		document.write('<img src=\"images/email.gif\" title=\"president.'+email+'\@altrusa.org.nz" align=\"right\" style=\"padding-top:5px;\" border=\"0\">');
		document.write('</a><br><a href=\"clubs_'+email+'.html\" title=\"'+email.toUpperCase()+'\" style=\"text-indent:0px\">'+email+'</a></font></td></tr>');
	}
	
	/* 	Write a link to the club information and the contact email details for the president 
		in the case where the name of the club contains special characters or whitespace */
	function writeSpecialContact(clubname,linkname,email) {
		
		document.write('<tr><td style="width:210px">');
		document.write('<a href=\"mailto:president.'+email+'@altrusa.org.nz\">');
		document.write('<img src=\"images/email.gif\" title=\"president.'+email+'\@altrusa.org.nz" align=\"right\" style=\"padding-top:5px;\" border=\"0\">');
		document.write('</a><br><a href=\"clubs_'+linkname+'.html\" title=\"'+clubname.toUpperCase()+'\" style=\"text-indent:0px;\">'+clubname+'</a></td></tr>');
	}
/* END OF CONTACT FUNCTIONS */

function startTable() {
	
	document.write('<table>');
}

function endTable() {
	
	document.write('</table>');
}

/* To write an orange heading in the left hand panel of the screen */
function writeHeading(heading) {
	
	document.write('<tr><td><h1>'+heading+'</h1></td></tr>');
}

/* To write a blue heading in the left hand panel of the screen */
function writeBlueHeading(heading) {
	
	document.write('<tr><td><h4>'+heading+'</h4></td></tr>');
}

/* 	To write a link in the left hand panel of the screen
	Used to list clubs, conference links, resource links, etc. */
function writeLink(linkname,pagename) {
	
	document.write('<tr><td><a href=\"'+linkname+'\" title=\"'+pagename+'\">'+pagename+'</a></td></tr>');
}

/* 	To write a photo in the left hand column that is padded with 50px of vertical space
	Used in the conference page, service projects page, etc. */
function writePaddedPhoto(photoname,photocaption) {
	
	document.write('<tr><td style=\"text-align:center;padding-top:50px;\"><img src=\"'+photoname+'\" title=\"'+photocaption.replace(/<br>/g," ")+'\" alt=\"'+photocaption.replace(/<br>/g," ")+'\"></td></tr>');
	document.write('<tr><td style=\"text-align:center;font-size:8pt">'+photocaption+'</td></tr>');
}
