/*
SHNC.js
Copyright: mickeywebdesign.com

Edit Log:
10Mar10: Removed LDC fax number
04Mar10: Changed menu headings New Vogue Dance to Dance Classes
02Feb10: Swapped getDate() for getFullDate() (former is buggy and now deprecated)
22Jan10: Modified NextMarketDate(). Added stepDate() & writeDate()
12Jan10: Remove Christmas Message
08Jan10: Created writeCD(), contacts() & getContactDetail() used in conjunction with Ecode() & Ehide()
11Dec09: 2009 Christmas Message
04Dec09: New URL for Surry Hills Markets
28Oct09: Added ComputerClasses
16Oct09: Added Painting & Drawing Classes
15Oct09: Removed Patch & Walking from Menu
14Oct09: Updated Market Dates
11Sep09: Added MovieMaking.htm
22May09: New telephone numbers & addresses
04Mar09: Change Stitch/Craft to PatchWork in menus, changed Festival link
27Jan09: Added NewVogueDance.htm
14Jan09: Deleted Festival, Surry and other obsolete menu items
12Dec08: Updated Forward Market Dates
22Nov08: Added function GetAdobeReader()
*/

function contacts(who)    {
        var managerC = new Array("Lauren", "02-9356 4977", "manager", "shnc.org")
        var multiC = new Array("Salma", "02-9356 4977", "projects", "shnc.org")
        var ldcC = new Array("Spring", "02-9331 8409", "children", "shnc.org")
        var ooshC = new Array("Leonie", "02-9331 1479 or 0434-284 332", "oosh", "shnc.org")
        var centreC = new Array("Centre Manager",  "02-9356 4977", "manager", "shnc.org")
        var festivalC = new Array("Cathy",  "02-9318 0087", "festival", "shnc.org")
        var marketC = new Array("Leeanne",  "0434-197 224", "market", "shnc.org")
        
        var blankC = new Array("","","","")        
        if (who=='manager') return managerC
        if (who=='multi') return multiC
        if (who=='ldc') return ldcC
        if (who=='oosh') return ooshC
        return blankC  
}

function getContactDetail(who, what)    {
        var contactA = new Array
        contactA = contacts(who)
        if (what=="firstname") return contactA[0] 
        if (what=="phone") return contactA[1] 
        if (what=="emailname") return contactA[2] 
        if (what=="emaildomain") return contactA[3] 
        return ""
}

function writeCD(who, what)  {
        if (what != 'email')    {
                document.write(getContactDetail(who, what))
        } else {
                Ehide (getContactDetail(who, 'emailname'), getContactDetail(who, 'emaildomain'))
        }
}

function Ecode	(show, name, domain)	{
        document.write('<a href="mai' + 'lto:' + name + '&#64;' + domain + '">')
        document.write(show + '</a>')
}

function Ehide  (name, domain)  {
        show = name + '[at]' + domain
        document.write('<a href="mai' + 'lto:' + name + '&#64;' + domain + '">')
        document.write(show + '</a>')
}

// Create MiniWindows for Translations
MiniWindow = null
function TurkishWindow () {
		MiniWindow = window.open("turkish.htm","catWin","width=400,height=500,top=100,left=100")
		}
function SpanishWindow () {
		MiniWindow = window.open("spanish.htm","catWin","width=400,height=500,top=100,left=100")
		}
function RussianWindow () {
		MiniWindow = window.open("russian.htm","catWin","width=400,height=500,top=100,left=100")
		}
					
// Close Any MiniWindow
function CloseMiniWindow() {
		if (MiniWindow && !MiniWindow.closed) {MiniWindow.close() }
		}

// Write Menu for Non Festival Pages
function SHNCMenu() {
GeneralItems()
ActivitiesItems()
ChildcareItems()
AboutUsItems()
// FestivalItems()
// SurryItems()
}
			
function GeneralItems() {
document.write('<b id="menucol">SHNC Pages</b><br>')
document.write('<a href="index.html">SHNC Home</a><br>')
document.write('<a href="http://www.mickeywebdesign.com/SHNC/ShowDiary.php" title="The SHNCs new diary by day diary of events and activities.">SHNC Diary</a><br>')
document.write('<a href="InformationReferral.htm">Advocacy & Referral</a><br>')
document.write('<a href="neighbourhood_centre_services.htm">Services</a><br>')
document.write('<a href="Multicultural.htm">Activities</a><br>')
document.write('<a href="Projects.htm">Projects</a><br>')
document.write('<a href="HallHire.htm">Room Hire</a><br>')
document.write('<a href="neighbourhood_centre_events.htm">Events</a><br>')
document.write('<a href="./markets/index.htm">Surry Hills Markets</a><br>')
document.write('<a href="./festival/index.htm">Surry Hills Festival</a><br>')
document.write('<a href="NonEnglish.htm">Other Language Help</a><br>   ')
document.write('<br>')
}

function AboutUsItems() {	
document.write('<b id="menucol">About the SHNC</b><br>')
document.write('<a href="AboutUs.htm">About Us</a><br>')
document.write('<a href="VolunteerMember.htm">Join Us</a><br>')
document.write('<a href="ContactUs.htm">Contact Us</a><br>')
// document.write('<a href="HelpUs.htm">Help Us</a><br>') HelpUs.htm needs attention
document.write('<a href="VolunteerMember.htm">Become a Volunteer</a><br>')
document.write('<a href="AnnualReports.htm">AGM, Annual Reports</a><br>')
// document.write('<a href="AGM.htm">Annual General Meeting</a><br>')
// document.write('<a href="QandA.htm">SHNC Q&A</a><br>')
document.write('<br>')
}
	
function ChildcareItems() {
document.write('<b id="menucol">Childrens Services</b><br>')
document.write('<a href="Childcare.htm">Children Home</a><br>')
document.write('<a href="LongDayCare.htm">Long Day Care</a><br>')
document.write('<a href="OccasionalChildcare.htm">Occasional Care</a><br>')
document.write('<a href="AfterSchoolCare.htm">After School Care</a><br>')
document.write('<a href="vacation_childcare.htm">Vacation Childcare</a><br>')
document.write('<a href="PlayGroup.htm">Playgroup</a><br>')	
document.write('<br>')
}
			
function SurryItems() {
document.write('<b id="menucol">The Surry</b><br>')			
document.write('<a href="TheSurry.htm">The Surry Home</a><br>')
document.write('<br>')
}

function ActivitiesItems()	{
document.write('<b id="menucol">Activities</b><br>')
document.write('<a href="Pilates.htm">Pilates Classes</a><br>')
document.write('<a href="computerClasses.htm">Computer Classes</a><br>')
document.write('<a href="artClasses.htm">Painting and Drawing</a><br>')
document.write('<a href="MovieMaking.htm">Movie Making Classes</a><br>')
document.write('<a href="NewVogueDance.htm">Dance Classes</a><br>')	
document.write('<a href="English_conversation_classes.htm">English Classes</a><br>')
document.write('<a href="multicultural_cooking_classes.htm">Cooking</a><br>')
document.write('<a href="People_Bus.htm">Excursions</a><br>')
// document.write('<a href="Walking.htm">Walking Group</a><br>')
document.write('<a href="TaiChi.htm">Tai Chi</a><br>')	
document.write('<a href="SewingClasses.htm">Sewing and Knitting</a><br>')
// document.write('<a href="StitchCraft.htm">Patch Work Classes</a><br>')
document.write('<a href="Blokes.htm">Blokes Business</a><br>')
document.write('<a href="NonEnglish.htm">No English?</a><br>')
document.write('			<br>')
	}

function FestivalItems() {
document.write('			<b id="menucol">Festival Pages</b><br>')
document.write('			<a href="surry_hills_festival.htm">Festival Home</a><br>')
// document.write('			<a href="Acknowledge2005.htm">Acknowledgements</a><br>')
// document.write('			<a href="FestivalPromotion.htm">Come to the Festival!</a><br>')
// document.write('			<a href="FestivalPlanning.htm">Planning</a><br>')
// document.write('			<a href="FestivalCommunity.htm">Community Information</a><br>')
document.write('			<a href="FestivalMedia.htm">Media Information</a><br>')
document.write('			<a href="FestivalStallholderInfo.htm">Stallholder Information</a><br>')
// document.write('			<a href="FestivalVolunteer.htm">Volunteer Information</a><br>')
document.write('			<a href="Performers.htm">Performer Information</a><br>')
document.write('			<a href="Sponsorship.htm">Sponsor Information</a><br>')
// document.write('			<a href="FestivalInterestOnLine.htm">Expression of Interest</a><br>')
document.write('			<br>')
			}	

function NextMarketDate () {
DatesInList = 12
MarketDates = new Array(DatesInList)
i = -1
	/* NOTE Months are 0=Jan, 1=Feb ... 11=Dec */
MarketDates[i++] = new Date(2009,10,7)
MarketDates[i++] = new Date(2009,11,5)
MarketDates[i++] = new Date(2010,0,2)
MarketDates[i++] = new Date(2010,1,6)
MarketDates[i++] = new Date(2010,2,6)
MarketDates[i++] = new Date(2010,3,3)
MarketDates[i++] = new Date(2010,4,1)
MarketDates[i++] = new Date(2010,5,5)
MarketDates[i++] = new Date(2010,6,3)
MarketDates[i++] = new Date(2010,7,7)
MarketDates[i++] = new Date(2010,8,4)
MarketDates[i++] = new Date(2010,9,2)
MarketDates[i++] = new Date(2010,10,6)
MarketDates[i++] = new Date(2010,11,4)


DaysOfWeek = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday")
MonthsOfYear = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
today = new Date

nextDate = today
i = -1
do {
	i++
	nextDate = MarketDates[i] 
}
while ( MarketDates[i] < today ) 
        return nextDate
}

function stepDate(date, step)    {
        date.setTime(date.getTime() + step * 24 * 60 * 60 * 1000)
        return date
}

function writeDate(jDate)       {
        Year = jDate.getFullYear()
        Month = jDate.getMonth()
        DayNo = jDate.getDate()
        DayName = jDate.getDay()
        document.write(DaysOfWeek[DayName] + ", " + DayNo + " " + MonthsOfYear[Month] + " " + Year )
}

// Snippets of Repeating Code	

function GetAdobeReader()	{
document.write('<p style="background:#f5f8ec; margin: 0 50px; border:1px solid black;">To download Adobe Reader free, click on this icon <a href="http://www.adobe.com/products/reader/" target="_blank"><img style="border:none;" src="images/get_adobe_reader.gif" alt="Click to get Adobe Reader" title="Click to get Adobe Reader"></a><p>') 
}

function SHNCFooter () {
document.write('<div id="footer">')
document.write('The Surry Hills Neighbourhood Centre, 405 Crown St, Surry Hills, NSW, 2010<br>')
document.write('Telephone: 02-9356 4977 Fax: 02-8354 0181 Festival: 02-9318 0087<br>')
document.write('Click ')
Ecode("here","manager","shnc.org")
document.write(' for Centre enquiries.')
document.write('Click <a href="AboutWeb.htm">here</a> for website enquiries.<br>')
document.write('</div>')
}

function SHNCLogo	()	{
document.write('<div id="SHNCLogo">')
document.write('<img class="noborder" src="images/SHNC_V3_crop.gif" alt="Logo of the Surry Hills Neighbourhood Centre">')
document.write('</div>')
}

function SHNCContact	(InMessage)	{
document.write('<div id="contact">')
document.write('<h2 id="contact">' + InMessage + '</h2>')
document.write('<p id="contact">ABN: 65 943 080 838<br>')
document.write('Surry Hills Community Centre, 1st Floor<br>')
document.write('405 Crown St, Surry Hills, NSW, 2010<br>')
document.write('Telephone: 02-9356 4977 Fax: 02-8354 0181 Festival: 02-9318 0087</p>')
document.write('<p id="contact">Childcare: Surry Hills Community Centre, 2nd Floor<br>')
document.write('Telephone: 02-9331 8409</p>')

// Christmas Insert
/*
document.write('<div id="xmas">')
document.write('<p id="xmas">The Surry Hills Neighbourhood Centre wishes all its clients and supporters<br>')
document.write("the very best for a safe and enjoyable Christmas and New Year's break.<br>")
document.write('<p id="xmas">The Centre will be closed from 24 December 2009 until 4 January 2010.</p>')
document.write('</div>')
*/
/*
document.write('<div id="xmas">')
document.write('<h5 id="xmas">We\'re back in Crown St! Come and see us soon.</h5>')
document.write('</div>')
*/

document.write('</div>')
document.write('<div id="dummyclear">')
document.write('</div>')
}

