// Blue South New Zealand Modules Javascript Code


		function faq_displayAnswer(id) {
			if (document.getElementById("faq_answer_" + id).style.display == "block") {
				document.getElementById("faq_answer_" + id).style.display = "none";
			} else {
				document.getElementById("faq_answer_" + id).style.display = "block";
			}
		}
		function faq_checkAnchor() {
				var url = location.href;
				var url_end = url.split("#");
				if(url_end[1]) var id = url_end[1].substr(1);
				faq_displayAnswer(id);
		}
		function faq_displayAll(amount) {
			var i = 1;
			while (i <= amount) {
				document.getElementById("faq_answer_" + i).style.display = "block";
				i++;
			}
		}
		function faq_hideAll(amount) {
			var i = 1;
			while (i <= amount) {
				document.getElementById("faq_answer_" + i).style.display = "none";
				i++;
			}
		}
					function mailinglist_subscribe_validate() {				if(document.getElementById('mailinglist_first_name') && document.getElementById('mailinglist_last_name')) mailinglist_concat_name();
				if (document.getElementById("mailinglist_name").value == '' || document.getElementById("mailinglist_name").value == ' ' || document.getElementById("mailinglist_name").value == 'Name') {
					alert('You must enter your name');
				} else				if (document.getElementById("mailinglist_email").value == '' || document.getElementById("mailinglist_email").value == 'Email') {
					alert('You must enter your email address');
				} else {
					return true;
				}
				return false;
			}
			function mailinglist_unsubscribe_validate() {
				if (document.getElementById("mailinglist_email").value == '' || document.getElementById("mailinglist_email").value == 'Email') {
					alert('You must enter your email address');
				} else {
					return true;
				}
				return false;
			}
			function mailinglist_concat_name() {
				document.getElementById('mailinglist_name').value = document.getElementById('mailinglist_first_name').value + ' ' + document.getElementById('mailinglist_last_name').value;
			}			function search_check(url) {
				var search = document.getElementById("id_search_box").value;
				if(search != '' && search != 'Search...') {
					if(!document.getElementById("id_search_form")) {
						window.location.href = url + '?search=' + search;
					} else {
						document.getElementById("id_search_form").submit();
					}
				}
			}

			function search_enter(e, url) {
				if(window.event) { // IE
					keynum = e.keyCode;
				} else if(e.which) { // Netscape/Firefox/Opera
					keynum = e.which;
				}
				if(keynum == 13) search_check(url);
			}function Users_passwordType(boolHide) {
	var username = document.getElementById('password_text');
	var password = document.getElementById('password_pass');
	if(password.value != '' || boolHide) {
		password.style.display = 'inline';
		username.style.display = 'none';
		if(boolHide) password.focus();
	} else {
		password.style.display = 'none';
		username.style.display = 'inline';
		username.value = 'Password';
	}
}