cms_timer		= null;		// Intiates the CMS timer - GLOBAL: can be used for any function
ajax_response	= '';		// Global value to store the respose from Ajax so that it can be used in other functions

/**
 * Submits a query via Ajax and runs a success function if required
 *
 * @return				void
 * @author				Nigel Wells
 * @version				1.0.07.11.09
 * @param function_name			The function that will be called in lib_ajaxrequest.php
 * @param criteria				Criteria to be sent to the php function
 * @param success_function		If set then this function will be called after the Ajax request has been successful
						- The response from Ajax will be stored in a global virable "ajax_response" which can then be accessed from function_name()
 * @param boolAlert			If true then it will alert the response returned from Ajax - Can be useful for debuging
 */
function loadAjaxFunctionKHP(function_name, criteria, success_function, boolAlert) {
	var strResponse = '';
	var status = false;

	if (criteria != '' && criteria != null && criteria != undefined) {
		criteria = "&" + criteria;
	} else {
		criteria = "";
	}
	AjaxRequest.get(
		{
		  'url':'/includes/ajax.php?ajax_function=' + function_name + criteria
		  ,'onSuccess':function(req){
			  var status = true;
			  strResponse = req.responseText; 
			  if (boolAlert === true) alert(strResponse);
			  if (success_function != '' && success_function != null && success_function != undefined) {
				  ajax_response = strResponse;
				  success_function += '()';
				  setTimeout(success_function, 1);
			  }
			  return strResponse;
		  }
		}
	);
}

/**
 * Submits a form via Ajax and runs a success function if required
 *
 * @return					void
 * @author					Nigel Wells
 * @version					1.0.08.07.03
 * @param form				Form object - NOTE: This must be the object and not just the name of the form
 * @param function_name		The function that will be called in lib_ajaxrequest.php
 * @param success_function	If set then this function will be called after the Ajax request has been successful
							- The response from Ajax will be stored in a global virable "ajax_response" which can then be accessed from function_name()
 * @param boolAlert			If true then it will alert the response returned from Ajax - Can be useful for debuging
 */
function submitAjaxFormKHP(form, function_name, success_function, boolAlert) {
	AjaxRequest.submit(
		form
		,{
			'url' : '/includes/ajax.php?ajax_function=' + function_name
			,'onSuccess' : function (req) {
				if (boolAlert === true) alert(req.responseText);
				if (success_function != '') {
					ajax_response = req.responseText;
					success_function += '()';
					setTimeout(success_function, 1);
				}
			}
			,'onError' : function (req) {alert(req.responseText)}
		}
	);
}

function displayMultiplePark(city) {
	// Hide all cities first
	var allPageTags = new Array(); 
	var allPageTags=document.getElementsByTagName("*");
	for (i=0; i<allPageTags.length; i++) if (allPageTags[i].className == 'map_multiple_cities') allPageTags[i].style.display = 'none';
	document.getElementById('map_' + city).style.display = 'block';
}

current_city_slide = '';
function activitySlide(city) {
	if(current_city_slide && document.getElementById('activity_' + current_city_slide)) document.getElementById('activity_' + current_city_slide).style.display = 'none';
	if (document.getElementById('activity_' + city))document.getElementById('activity_' + city).style.display = 'block';
	current_city_slide = city;
}