/*
SHNC.js         [C]mickeywebdesign.com

Edit Log: E:\My Documents\Webs\SHNC\Log.doc     E:\My Documents\Webs\SHNC\Structure.xls
15Jan12: Restyled SHNCContact()
15Jan12: Divided menucol blocks with <hr>, not <br>
13Jan12: Removed Carers Week from Activities menu
12Nov11: Removed Christmas Market date
25Oct11: Added bookClub.htm
22Sep11: Added Site Map sitetree.php to menu
20Sep11:    Added webmaster for use by AboutWeb.htm
16Sep11:    Market Dates update, and FutureMarketDatesList();
05Aug11:    Added steppingOn.htm to Activities menu
17Jun11:        Added carersWeek.htm to Activities menu
15Jun11:        Added a generic 'office' to the staff list
15Jun11:        Added taxHelp.htm to Activities menu
07Jun11:        Added Prue
02Jun11:        Changed Tania to Gillian
24Mar11: Added Opening Hours
07Feb11: Corrected error in Market dates
21Jan11: Updated bourkest.oosh contacts
12Jan11: Removed NewVogueDance.htm link
19Dec10: 2011 Market Dates
26Nov10: Minor correction to contact details
03Nov10: Added bsasc Bourke St ASC to 
11Oct10: Removed link to Pilates classes
30Jul10: Removed Occasional Care from the menu list
14Jul10: Added 'reception' to contacts()
02Jul10: Corrected broken link
20Jun10: Added Feedback button in SHNCContact() L261-2
24Apr10: Replaced Lauren with Tania
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()
*/

/*
 FROM HTML, <SCRIPT LANGUAGE="JAVASCRIPT" TYPE="TEXT/JAVASCRIPT">writeCD("manager","firstname")</SCRIPT>
    manager             firstname
    administration      phone
    multi               email
    ldc                 mobile
    oosh
    bourkest.oosh
    assistmanager
    office
*/
function contacts(who)    {
        var managerC = new Array("Gillian", "02-9356 4977", "manager", "shnc.org")
        var assistmanagerC = new Array("Prue", "02-9356 4977", "assistmanager", "shnc.org")
        var receptionC = new Array("Lynn", "02-9356 4977", "reception", "shnc.org")
        var multiC = new Array("Prue", "02-9356 4977", "assistmanager", "shnc.org")
        var ldcC = new Array("Spring", "02-9331 8409", "children", "shnc.org")
        var ooshC = new Array("Leonie Atterton", "02-9331 1479 or 0434-284 332", "oosh", "shnc.org","0434-284 332")
		var bsacs = new Array("Catherine Stanmore", "02 9318 0067", "bourkest.oosh", "shnc.org", "0434 193 983")
        var centreC = new Array("Centre Manager",  "02-9356 4977", "manager", "shnc.org")
        var festivalC = new Array("Gillian",  "02-9318 0087", "manager", "shnc.org")
        var marketC = new Array("Amber",  "0434-197 224", "market", "shnc.org")
        var officeC = new Array("the office", "02-9356 4977", "manager", "shnc.org")
        var webmasterC = new Array("Webmaster", "02-9380 7331", "mike", "mickeywebdesign.com")
        
        var blankC = new Array("","","","")        
        if (who=='manager') return managerC
        if (who=='assistmanager') return assistmanagerC
		if (who=='administration') return receptionC
        if (who=='multi') return multiC
        if (who=='ldc') return ldcC
        if (who=='oosh') return ooshC
		if (who=='bourkest.oosh') return bsacs
		if (who=='reception') return receptionC
        if (who=='office') return officeC
        if (who=='webmaster') return webmasterC
        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]
		if (what=="mobile") return contactA[4]
        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="sitetree.php">Site Map</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('<hr>')
}

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="QandA.htm">SHNC Q&A</a><br>')
document.write('<hr>')
}
	
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('<hr>')
}
			
function SurryItems() {
document.write('<b id="menucol">The Surry</b><br>')			
document.write('<a href="TheSurry.htm">The Surry Home</a><br>')
document.write('<hr>')
}

function ActivitiesItems()	{
document.write('<b id="menucol">Activities</b><br>')
document.write('<a href="bookClub.htm" title="Click here for Book Club, a monthy meeting to discuss a particular book" alt="Click here for Book Club, a monthy meeting to discuss a particular book">Book Club</a><br>')
document.write('<a href="steppingOn.htm" title="Click here for Stepping On, a program to encourage safe walking inside and outside the home" alt="Click here for Stepping On, a program to encourage safe walking inside and outside the home">Stepping On</a><br>')
// document.write('<a href="Pilates.htm">Pilates Classes</a><br>')
document.write('<a href="taxHelp.htm">Free Tax Help</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 Group</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="carersWeek.htm">Carers\' Week</a><br>')
document.write('<a href="NonEnglish.htm">No English?</a><br>')
document.write('			<hr>')
	}

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('			<hr>')
}

/*
 Note Market Dates have to be edited in SHNC.js and markets/shmStallForm.php
*/
function MarketDatesArray() {
    DatesInList = 12
    MarketDates = new Array(DatesInList)
    i = -1
        /* NOTE Months are 0=Jan, 1=Feb ... 11=Dec */
    MarketDates[i++] = new Date(2000,0,1)   /* Don't Remove */
    
    MarketDates[i++] = new Date(2011,9,1)   /* 1Oct2011 */
    MarketDates[i++] = new Date(2011,10,5)  /* 5Nov2011 */
    MarketDates[i++] = new Date(2011,11,3)  /* 3Dec2011 */
    MarketDates[i++] = new Date(2012,0,7)   /* 7Jan2012 */
    MarketDates[i++] = new Date(2012,1,4)  /* 4Feb2012 */
    MarketDates[i++] = new Date(2012,2,3)  /* 3Mar2012 */
    MarketDates[i++] = new Date(2012,3,7)   /* 7Apr2012 */
    MarketDates[i++] = new Date(2012,4,5)  /* 5May2012 */
    MarketDates[i++] = new Date(2012,5,2)  /* 2Jun2012 */
    MarketDates[i++] = new Date(2012,6,7)   /* 7Jul2012 */
    MarketDates[i++] = new Date(2012,7,4)  /* 4Aug2012 */
    MarketDates[i++] = new Date(2012,8,1)  /* 1Sep2012 */
    MarketDates[i++] = new Date(2012,9,6)   /* 6Oct2012 */
    MarketDates[i++] = new Date(2012,10,3)  /* 3Nov2012 */
    MarketDates[i++] = new Date(2012,11,1)  /* 1Dec2012 */
    
    return MarketDates ;
}

function FutureMarketDatesList()    {
    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")
    document.write('<div class="neutral"><h3>Future Market Dates</h3>')
    document.write('<table class="realtable cellshade">')
    MarketDates = MarketDatesArray() ;
    for (var i=0; i<MarketDates.length; i++)   {
        document.write("<tr><td>")
        Year = MarketDates[i].getFullYear()
        Month = MarketDates[i].getMonth()
        DayNo = MarketDates[i].getDate()
        DayName = MarketDates[i].getDay()
        document.write(DaysOfWeek[DayName] + ", " + DayNo + " " + MonthsOfYear[Month] + " " + Year )
        document.write("</td></tr>")
    }
    document.write('</table></div>')
}

function NextMarketDate () {
    MarketDates = MarketDatesArray();
    
    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('Website: <a href="http://www.shnc.org">www.shnc.org</a><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 hidemobile" src="images/Logo2011.gif" alt="Logo of the Surry Hills Neighbourhood Centre">')
document.write('</div>')
}

function SHNCContact	(InMessage)	{
document.write('<div class="contact">')
document.write('<h2>' + InMessage + '</h2>')
document.write('<table><tr>')
document.write('<td width="300px"><p><a href="http://www.facebook.com/SurryHillsNeighbourhoodCentre" alt="Click to join us on Facebook" title="Click to join us on Facebook"><img src="images/Icon_Facebook50px.png" class="noborder"></a><br>The Surry Hills Neighbourhood Centre welcomes your feedback on any matter concerning our services. Click the button below to post your feedback, anonymously if you wish.</p><form method="post" action="http://www.mickeywebdesign.com/SHNC/feedback.php">')
document.write('<input type="submit" value="Post Feedback"></form>')
document.write('<td><p>ABN: 65 943 080 838<br>')
document.write('1st Floor, Surry Hills Library and Community Centre<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<br>')
document.write('Opening Hours: 10:00am - 4:00pm Mon - Fri</p>')
document.write('<p>Website: <a href="http://www.shnc.org">www.shnc.org</a></p>')
document.write('<p>Childcare: 2nd Floor, Surry Hills Community Centre<br>')
document.write('Telephone: 02-9331 8409</p>')
document.write('</table>')

// 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>')
}


