//
// Javascript required for the "Take a Tour" page
//


// Initalise the current hotspot to south street
var current_hotspot = "2.3";

/*
 * Displays a hotspot's title, copy, and image in document next to the flash
 *
 * @param string hotspot_id			// e.g '1.1'
 */

function display_hotspot( hotspot_id )
{
	// Update the current hotspot location
	current_hotspot = hotspot_id;

	// Fetch hotspot data
	var hotspot_list = load_hotspot_list();

	// Select requested hotspot from list
	hotspot = hotspot_list[hotspot_id];

	// Define location of hotspot content
	var hotspot_title 	= document.getElementById("hotspot_title");
	var hotspot_copy 	= document.getElementById("hotspot_copy");
	var hotspot_image 	= document.getElementById("hotspot_image");

	// Display new content in document
	hotspot_title.innerHTML = hotspot["hotspot_title"];
	hotspot_copy.innerHTML 	= hotspot["hotspot_copy"];
	hotspot_image.src 		= hotspot["hotspot_image"];
	hotspot_image.alt 		= hotspot["hotspot_title"];

	// Adjust the visibility of the hotspot back/next buttons
	if( (hotspot_id == "2.1") || (hotspot_id == "2.2") )
	{
		document.getElementById('hotspot_previous').style.display = 'none';
		document.getElementById('hotspot_next').style.display = 'none';
	}
	else
	{
		document.getElementById('hotspot_previous').style.display = '';
		document.getElementById('hotspot_next').style.display = '';
	}
}


/*
 * This function returns an array of Hotspot locations
 *
 * @return Array()
 */

function load_hotspot_list()
{
	hotspot_list = new Array();

	hotspot_list['1.1'] = new Array();
	hotspot_list['1.1']['hotspot_title'] 	= 'Library &amp; Learning Common';
	hotspot_list['1.1']['hotspot_copy'] 	= '<p class="content">Situated on Bush Court, the Learning Common provides 24-hour computer access, dedicated spaces for wireless laptops and a range of support services including staff assistance and security.  The Learning Common is ideal for students who find themselves working long hours and are short on time to find their way around the range of services available.</p>';
	hotspot_list['1.1']['hotspot_copy'] 	+= '<p class="content">The Learning Common is a  &lsquo;one-stop-shop&rsquo; which provides first year students with a whole of university integrated service to support their transition to university. Students&rsquo; success and retention at University can be connected to students feeling they are welcomed. </p>';
	hotspot_list['1.1']['hotspot_image'] 	= '/_image/tools/tour/library.jpg/';

	hotspot_list['1.2'] = new Array();
	hotspot_list['1.2']['hotspot_title'] 	= 'Bush Court';
	hotspot_list['1.2']['hotspot_copy'] 	= '<p class="content">Meeting, greeting and sharing experiences is an important part of university life, and Bush Court is where it all happens for students on our South Street campus. This break-out area is a popular year-round haunt &ndash; but really comes into its own during &lsquo;O&rsquo; week festivities and activities such as our Guild festivals. Designed as a quadrangle, it is open on its north side to take advantage of the spectacular view towards the Perth city skyline. </p>';
	hotspot_list['1.2']['hotspot_image'] 	= '/_image/tools/tour/bush_court.jpg/';

	hotspot_list['1.3'] = new Array();
	hotspot_list['1.3']['hotspot_title'] 	= 'School of Biological Sciences &amp; Biotechnology';
	hotspot_list['1.3']['hotspot_copy'] 	= '<p class="content">The past 25 years have seen as much change inflicted on the world of science as on almost any other sphere of study, and we&rsquo;ve worked hard to develop our expertise and world class reputation across all the key disciplines. Our ground-breaking exploration of molecular genetics, for example, has helped move genetic engineering out of the realm of science fiction and into the reality of our daily lives. In Molecular Biology and Conservation and Wildlife Biology we are at the forefront of developments into the increasing impact of humans on our ecosystems, and our forensic and toxicology courses embrace latest thinking in areas such as DNA analysis and profiling.</p>';
	hotspot_list['1.3']['hotspot_image'] 	= '/_image/tools/tour/bio_sciences.jpg/';

	hotspot_list['1.4'] = new Array();
	hotspot_list['1.4']['hotspot_title'] 	= 'Kim E Beazley Lecture Theatre';
	hotspot_list['1.4']['hotspot_copy'] 	= '<p class="content">We could think of no more fitting a tribute to Mr Kim Beazley Senior, than to name Murdoch&rsquo;s major lecture theatre after him. His service to the nation - and particularly to our University as a former Senate member and Pro Chancellor - is reflected in the theatre&rsquo;s grandeur and magnificent facilities. As one of the University&rsquo;s original lecture theatres, the theatre underwent a complete refurbishment in 2004, and can now comfortably accommodate 300 guests.</p>';
	hotspot_list['1.4']['hotspot_image'] 	= '/_image/tools/tour/kim_beazley.jpg/';

	hotspot_list['1.5'] = new Array();
	hotspot_list['1.5']['hotspot_title'] 	= 'Interactive Television Research Institute';
	hotspot_list['1.5']['hotspot_copy'] 	= '<p class="content">Under the experienced guidance of Director; Professor Duane Varan, our Interactive Television Research Institute (ITRI) is widely acclaimed as a truly world-class research hub - and as such, has been able to secure significant government development funding. Included in Professor Varan&rsquo;s line-up of state-of-the-art technologies for measuring audience behaviour are a full-reference digital head end, eye gaze measurement tool which maps viewer eye movement over the TV screen, perception analysers, and advanced video arching systems.</p>';
	hotspot_list['1.5']['hotspot_image'] 	= '/_image/tools/tour/itri.jpg/';

	hotspot_list['1.6'] = new Array();
	hotspot_list['1.6']['hotspot_title'] 	= 'Media Labs';
	hotspot_list['1.6']['hotspot_copy'] 	= '<p class="content">If you&rsquo;re drawn to the glare of the media spotlight, our new $1.7 million state-of-the-art Media Arts Centre is just the place to get your creative juices flowing. Aspiring news hounds can develop their skills in our fully-equipped newsroom; which is set up to manage every aspect of newspaper and magazine production - from copy generation through to pre-press completion or online distribution. Our television and radio studios boast broadcast quality production facilities, and for TV buffs there&rsquo;s the added advantage of widescreen broadcast technology and computer-based digital switching. </p>';
	hotspot_list['1.6']['hotspot_image'] 	= '/_image/tools/tour/media_labs.jpg/';

	hotspot_list['1.7'] = new Array();
	hotspot_list['1.7']['hotspot_title'] 	= 'Veterinary Farm &amp; Clinic';
	hotspot_list['1.7']['hotspot_copy'] 	= '<p class="content">Murdoch is home to the newest of the four Veterinary Science Schools in Australia. We have an entire working farm, a 24 hour veterinary clinic open to the public, a fully equipped Veterinary Hospital [complete with Cancer and Dermatology Clinics], a Pet Emergency Centre with &ldquo;Animal ER&rdquo; services and our world class Equine Centre with WA&rsquo;s only equine operating theatres.</p>';
	hotspot_list['1.7']['hotspot_copy'] 	+= '<p class="content">The School is heavily involved in research for animal diseases and training of specialist veterinarians in their field of choice.</p>';
	hotspot_list['1.7']['hotspot_image'] 	= '/_image/tools/tour/vet2.jpg/';

	hotspot_list['1.8'] = new Array();
	hotspot_list['1.8']['hotspot_title'] 	= 'Chiropractic Clinic';
	hotspot_list['1.8']['hotspot_copy'] 	= '<p class="content">With our digital x-rays, paperless processes and state of the art equipment, it&rsquo;s perhaps not surprising that the University&rsquo;s Chiropractic clinic is considered to be among the most advanced in the world. Innovative advanced therapies and best-practice patient care services are delivered from our 13 fully-equipped and web-enabled treatment rooms, and we also have a supervised rehabilitation centre and physiological therapeutic modalities capability. </p>';
	hotspot_list['1.8']['hotspot_copy'] 	+= '<p class="content">Murdoch&rsquo;s Chiropractic course is practice-focused and patient-orientated. Students receive extensive clinical training under supervision in the new University clinic by experienced, participating Chiropractors.</p>';
	hotspot_list['1.8']['hotspot_image'] 	= '/_image/tools/tour/chiro.jpg/';

	hotspot_list['1.9'] = new Array();
	hotspot_list['1.9']['hotspot_title'] 	= 'Law School';
	hotspot_list['1.9']['hotspot_copy'] 	= '<p class="content">Murdoch University houses a state-of-the-art Law School, including the $3.7m Freehills Electronic Moot Court and lecture theatre.  The Moot Court is a mock court where law students try hypothetical cases; it also doubles as a lecture theatre complete with videoconferencing, imaging and internet technologies.</p>';
	hotspot_list['1.9']['hotspot_copy'] 	+= '<p class="content">Murdoch&rsquo;s Law building was opened by the Honourable Chief Justice David Malcolm and Sir Ronald Wilson in 2004.  In addition to the Freehills Electronic Moot Court, the building contains two tutorial rooms, two computer laboratories, the Law administrative offices and offices for Southern Communities Advocacy and Legal Education Service (SCALES). </p>';
	hotspot_list['1.9']['hotspot_image'] 	= '/_image/tools/tour/law_school.jpg/';

	hotspot_list['1.10'] = new Array();
	hotspot_list['1.10']['hotspot_title'] 	= 'Environmental Technology Centre';
	hotspot_list['1.10']['hotspot_copy'] 	= '<p class="content">Murdoch University is committed to helping the environment, especially through the Environmental Technology Centre (ETC) which researches, develops and demonstrates environmental technologies, conducts education and training, provides consultancy services to industry and aims to raise community awareness of environmental technologies. </p>';
	hotspot_list['1.10']['hotspot_copy'] 	+= '<p class="content">Energy efficient building design, renewable energy systems for power supply and water pumping, aquaculture systems, organic waste management and permaculture are all applied and researched at the ETC.</p>';
	hotspot_list['1.10']['hotspot_image'] 	= '/_image/tools/tour/enviro_tech.jpg/';

	hotspot_list['1.11'] = new Array();
	hotspot_list['1.11']['hotspot_title'] 	= 'Nexus Theatre';
	hotspot_list['1.11']['hotspot_copy'] 	= '<p class="content">The 175-seat, fully air-conditioned Nexus Theatre has been home to performances by some of Western Australia&rsquo;s emerging talent since 1994.  Featuring a flexible, contemporary design with unobstructed viewing, the Nexus Theatre also provides local community groups, schools and theatre companies with a professional and affordable space for a range of cultural events and performance</p>';
	hotspot_list['1.11']['hotspot_image'] 	= '/_image/tools/tour/nexus_theatre.jpg/';

	hotspot_list['1.12'] = new Array();
	hotspot_list['1.12']['hotspot_title'] 	= hotspot_list['1.7']['hotspot_title'];
	hotspot_list['1.12']['hotspot_copy'] 	= hotspot_list['1.7']['hotspot_copy'];
	hotspot_list['1.12']['hotspot_image'] 	= '/_image/tools/tour/vet.jpg/';

	hotspot_list['1.13'] = new Array();
	hotspot_list['1.13']['hotspot_title'] 	= 'Tavern';
	hotspot_list['1.13']['hotspot_copy'] 	= '<p class="content">Our new tavern, which opened in 2007, is nestled between the trees opposite the recreation centre on our popular Bush court. It offers modern facilities and well thought out design features including a beer garden, veranda area and a function room that can be sectioned off from the main area.</p><p class="content">The tavern aims to provide a central meeting place for staff and students who can come and relax and converse side-by-side. This will add to the strong sense of community on campus.</p><p class="content">It is close to all the University\'s major facilities and within walking distance to the South Street bus routes, the new tavern aims to attract a healthy clientele.</p>';
	hotspot_list['1.13']['hotspot_image'] 	= '/_image/tools/tour/tavern.jpg/';


		//
		// Campus hotspots
		//
		hotspot_list['2.1'] = new Array();
		hotspot_list['2.1']['hotspot_title'] 	= 'Rockingham campus';
		hotspot_list['2.1']['hotspot_copy'] 	= '<p class="content">The lively and popular foreshore precinct, with its buzzing caf&eacute; culture and relaxed atmosphere, provides a fitting backdrop to our Rockingham campus. Its modern facilities and individualistic approach to study and student life are evident in its purpose-built facilities and cutting edge resources. Friendly staff are on hand to help and offer guidance, we&rsquo;re just 45km from the centre of Perth, and our excellent communication hub makes sure students are never more than a mouse click away from their family and friends.</p>';
		hotspot_list['2.1']['hotspot_image'] 	= '/_image/tools/tour/rockingham.jpg/';

		hotspot_list['2.2'] = new Array();
		hotspot_list['2.2']['hotspot_title'] 	= 'Peel campus';
		hotspot_list['2.2']['hotspot_copy'] 	= '<p class="content">The vibrant coastal town of Mandurah plays host to WA&rsquo;s first co-located Education and TAFE campus. The innovative multi-partner campus comprises school, TAFE and University sectors and means students can immerse themselves in seamless programs of study through our matrix of carefully-designed pathways. Peel campus boasts purpose-built facilities for Nursing and Business students, and the facility is equipped with the latest audio-visual equipment, state-of-the-art IT resources, i-lecture facilities for virtual learning experiences, and its own wireless LAN.</p>';
		hotspot_list['2.2']['hotspot_image'] 	= '/_image/tools/tour/peel.jpg/';

		hotspot_list['2.3'] = new Array();
		hotspot_list['2.3']['hotspot_title'] 	= 'South Street campus';
		hotspot_list['2.3']['hotspot_copy'] 	= '<p class="content">The South Street campus is located 15km south of the Perth CBD and 8km east of Fremantle. The central location of the campus makes it easily accessible for students across the metropolitan area, particularly due to the proximity of the Kwinana Freeway and the new rail line.</p>';
		hotspot_list['2.3']['hotspot_copy'] 	+= '<p class="content">The campus is set in a beautiful bush environment and covers over 227 hectares, making it the largest campus in Australia.</p>';
		hotspot_list['2.3']['hotspot_copy'] 	+= '<p class="content">Students at the South Street campus have access to a large range of facilities and support services as well as numerous computing labs and a wireless network.</p>';
		hotspot_list['2.3']['hotspot_image'] 	= '/_image/tools/tour/south_st.jpg/';

	hotspot_list['3.1'] = new Array();
	hotspot_list['3.1']['hotspot_title'] 	= 'Alumni, Careers and <br />Employment (ACE) Centre';
	hotspot_list['3.1']['hotspot_copy'] 	= '<p class="content">Planning your career?  Start here at the ACE Centre.  Our Career Advisors can help with one-on-one advice, r&eacute;sum&eacute; checks, addressing selection criteria and interview preparation. They also arrange the annual on-campus Careers Fair, employer campus visits, presentations to student groups and job seeking seminars - everything you need to make the most of marketing yourself and boosting your employability.</p>';
	hotspot_list['3.1']['hotspot_image'] 	= '/_image/tools/tour/alumni.jpg/';

	hotspot_list['3.2'] = new Array();
	hotspot_list['3.2']['hotspot_title'] 	= 'Child Care Centre';
	hotspot_list['3.2']['hotspot_copy'] 	= '<p class="content">Juggling the demands of having children while you&rsquo;re studying can be a challenge.  Our Child Care Centre is here to help.  Located at the South Street campus, the Centre can accommodate up to 48 children between the ages of six months and six years. Managed by the Murdoch University Child Care Association, the Centre meets regulations set by the Commonwealth and State Departments of Community Services.  Student subsidies are available, and parents are invited to get involved with the centre through their exciting range of activities.</p>';
	hotspot_list['3.2']['hotspot_image'] 	= '/_image/tools/tour/childcare.jpg/';

	hotspot_list['3.3'] = new Array();
	hotspot_list['3.3']['hotspot_title'] 	= 'Computing and Access Labs ';
	hotspot_list['3.3']['hotspot_copy'] 	= '<p class="content">24/7 access to computer labs, wireless internet, an email address and an internet access account.  These are just some of the features available to students through the Murdoch Student Network.  Students can also access Murdoch Net, the library, online courses, dial-in facilities if you are working off-campus and - for students enrolled in certain units - specialist computer facilities. </p>';
	hotspot_list['3.3']['hotspot_image'] 	= '/_image/tools/tour/computer_lab.jpg/';

	hotspot_list['3.4'] = new Array();
	hotspot_list['3.4']['hotspot_title'] 	= 'Food';
	hotspot_list['3.4']['hotspot_copy'] 	= '<p class="content">Is all that learning making you hungry?  Enjoy a quick bite or a meal at &lsquo;The Ref&rsquo; &ndash; the food hall on South Street campus.  The Student Guild manages the Tavern (a social hub on campus), Sir Walter&rsquo;s Caf&eacute; (set in a leafy library courtyard) and Little Walter&rsquo;s on Bush Court.  Stalls and caravans around campus offer food and drinks throughout the academic year.  At the Rockingham campus, choose from a variety of caf&eacute; foods and drinks at the Coffee Shop.</p>';
	hotspot_list['3.4']['hotspot_image'] 	= '/_image/tools/tour/food.jpg/';

	hotspot_list['3.5'] = new Array();
	hotspot_list['3.5']['hotspot_title'] 	= 'Health and Counselling';
	hotspot_list['3.5']['hotspot_copy'] 	= '<p class="content">If you&rsquo;re not feeling well while on campus, visit the Health and Counselling Centre.  A nurse is available during working hours, or you can make a GP appointment with one of our doctors.</p>';
	hotspot_list['3.5']['hotspot_copy'] 	+= '<p class="content">Nursing staff can provide advice about simple medications, first aid treatment and general tips on developing good nutrition and lifestyle habits.  Red Cross First Aid and CPR training are also available for students.</p>';
	hotspot_list['3.5']['hotspot_image'] 	= '/_image/tools/tour/health_counselling.jpg/';

	hotspot_list['3.6'] = new Array();
	hotspot_list['3.6']['hotspot_title'] 	= 'Student Housing';
	hotspot_list['3.6']['hotspot_copy'] 	= '<p class="content">Just a few minutes walk from the library, laboratories and lecture theatres, Student Village is a friendly residential community situated on the Murdoch campus.</p>';
	hotspot_list['3.6']['hotspot_copy'] 	+= '<p class="content">Student Village is home to more than 530 students from a variety of backgrounds and cultures and provides students with the opportunity to make new friends and become independent.  Each of the fully-furnished flats has three to eight studies and bedrooms, as well as basic cooking equipment.  Most students have a single room, while others share one of the 30 twin share rooms.</p>';
	hotspot_list['3.6']['hotspot_copy'] 	+= '<p class="content">Flats with modified bedrooms, bathrooms and kitchens are available to students with disabilities.</p>';
	hotspot_list['3.6']['hotspot_image'] 	= '/_image/tools/tour/student_housing.jpg/';

	hotspot_list['3.7'] = new Array();
	hotspot_list['3.7']['hotspot_title'] 	= 'Worship Centre';
	hotspot_list['3.7']['hotspot_copy'] 	= '<p class="content">The Worship Centre on the Murdoch campus is open to people of all faiths. The specially designed centre is a multi faith facility and can be modified to suit the needs of Muslims, Hindus, Buddhists and Baha&rsquo;is. An Anglican Eucharist and Catholic Communion are held weekly. </p>';
	hotspot_list['3.7']['hotspot_copy'] 	+= '<p class="content">Anglican and Catholic Chaplains are available for pastoral counselling and to discuss matters of a religious or personal nature in complete confidence, irrespective of your denomination. The Chaplaincy offices are located on the ground floor of the Social Sciences building, near Bush Court.</p>';
	hotspot_list['3.7']['hotspot_image'] 	= '/_image/tools/tour/worship_centre.jpg/';

	hotspot_list['3.8'] = new Array();
	hotspot_list['3.8']['hotspot_title'] 	= 'Kulbardi Aboriginal Centre';
	hotspot_list['3.8']['hotspot_copy'] 	= '<p class="content">Situated in the Amenities building, the Kulbardi Centre supports Aboriginal and Torres Strait Islander students through a range of programmes including one-on-one tutoring through the Aboriginal Tutorial Assistance Scheme (ATAS). </p>';
	hotspot_list['3.8']['hotspot_copy'] 	+= '<p class="content">The Centre also offers computers, a resource library, photocopying and study facilities, as well as a common room for students to relax.  Students are provided with a voice on and off campus through the Murdoch Aboriginal and Islander Students&rsquo; Association (MAISA).</p>';
	hotspot_list['3.8']['hotspot_image'] 	= '/_image/tools/tour/kulbardi.jpg/';

	hotspot_list['3.9'] = new Array();
	hotspot_list['3.9']['hotspot_title'] 	= 'Guild Service Centre';
	hotspot_list['3.9']['hotspot_copy'] 	= '<p class="content">At the heart of campus life is the Murdoch University Guild of Students.  The Guild runs the Sports and Recreation Centre, Second-Hand Book Exchange, Sir Walter&rsquo;s Caf&eacute;, Little Walters, the Tavern, vending machines and the Guild Shop.</p>';
	hotspot_list['3.9']['hotspot_copy'] 	+= '<p class="content">Most importantly, the Guild represents students in educational issues (such as tuition fees, Youth Allowance and Austudy entitlements) that involve the University, Federal and State Governments and their agencies.</p>';
	hotspot_list['3.9']['hotspot_image'] 	= '/_image/tools/tour/guild.jpg/';

	return hotspot_list;
}

/*
 * Change the campus map in the Flash Movie
 *
 * @param int campus_id
 * @param string flash_id
 */
function display_campus( campus_id, flash_id )
{
        delete(flash);

	var flash;
        flash = document.getElementById(flash_id);

	// Change the campus
	flash.show_campus( campus_id );
}


/*
 * Display the previous campus
 *
 * If the first campus is displayed, display the last
 *
 * @param string flash_id
 */

function previous_campus( flash_id )
{
	var flash;

	if( navigator.appName.indexOf("Microsoft") != -1 )
	{
		flash = eval('window. ' + flash_id);
	}
	else
	{
		flash = eval('window.document.' + flash_id);
	}

	flash.previous();
}


/*
 * Display the next campus
 *
 * If the last campus is being displayed, go to the previous
 *
 * @param string flash_id
 */
function next_campus( flash_id )
{
	var flash;

	if( navigator.appName.indexOf("Microsoft") != -1 )
	{
		flash = eval('window. ' + flash_id);
	}
	else
	{
		flash = eval('window.document.' + flash_id);
	}

	flash.next();

}


/*
 * Load the next hotspot for south street campus
 *
 * Note: This requires modification as it requires knowledge of the first
 * hotspot element and which not to include (1.1, 2.1, 2.2)
 */
function next_hotspot()
{
	// Load list of hotspots
	var hotspot_list = load_hotspot_list();

	// Keep track of the loops
	var fetch_next = false;

	// Find the current hotspot
	for( hotspot in hotspot_list )
	{
		if( fetch_next == true )
		{
			// Skip the campus hotspots
			if( (hotspot != "2.1") && (hotspot != "2.2") )
			{
				// This is the next hotspot
				break;
			}
		}

		if( hotspot == current_hotspot )
		{
			// The current position has been found
			fetch_next = true;
		}
	}

	// Current position was last on array, so wrap the hotspot back to the start of the list
	if( hotspot == current_hotspot )
	{
		hotspot = "1.1";
	}

	display_hotspot( hotspot );
}


/*
 * Load the previous hotspot for south street campus
 *
 * Note: This requires modification as it requires knowledge of the first
 * hotspot element and which not to include (2.1, 2.2, 3.9)
 */
function previous_hotspot()
{
	// Load list of hotspots
	var hotspot_list = load_hotspot_list();

	// Keep track of the loops
	var fetch_next = false;

	var previous_hotspot = "";

	// Find the current hotspot
	for( hotspot in hotspot_list )
	{
		if( hotspot == current_hotspot )
		{
			// The current position has been found
			break;
		}

		if( (hotspot != "2.1") && (hotspot != "2.2") )
		{
			// Update the previous position
			previous_hotspot = hotspot;
		}
	}

	// If current position is first element in array, the previous hotspot wont be
	// set, it needs to be manually specified
	if( previous_hotspot == "" )
	{
		previous_hotspot = "3.9";
	}

	display_hotspot( previous_hotspot );
}