﻿// file: exploreMenu.js
// purpose: control show/hide the menu 
// use: for the explore New Zealand module
//______________________________________________//

	    showNorth = function() {
	        $('#menuNorth').slideDown("fast");
	        $('#menuSouth').slideUp("fast");
	        $('a#linkNorth').addClass("open");
	        $('a#linkNorth').removeClass("closed");
	        $('a#linkSouth').addClass("closed");
	        $('a#linkSouth').removeClass("open");
	        $('a#tabNorth').addClass("current");
	        $('a#tabSouth').removeClass("current");
	        $('a#tabRegion').removeClass("current");
	        $('#mapNorth').show();
	        $('#mapSouth').hide();
	        $('#mapRegion').hide();
	        $('#textNorth').show();
	        $('#textSouth').hide();
	        $('#textNorthTravelTip').show();
	        $('#textSouthTravelTip').hide();
	        
	    }

	    showSouth = function() {
	        $('#menuNorth').slideUp("fast");
	        $('#menuSouth').slideDown("fast");
	        $('a#linkSouth').addClass("open");
	        $('a#linkSouth').removeClass("closed");
	        $('a#linkNorth').addClass("closed");
	        $('a#linkNorth').removeClass("open");
	        $('a#tabSouth').addClass("current");
	        $('a#tabNorth').removeClass("current");
	        $('a#tabRegion').removeClass("current");
	        $('#mapNorth').hide();
	        $('#mapSouth').show();
	        $('#mapRegion').hide();
	        $('#textNorth').hide();
	        $('#textSouth').show();
	        $('#textNorthTravelTip').hide();
	        $('#textSouthTravelTip').show();
	    }

	    showRegion = function() {
	        $('a#tabSouth').removeClass("current");
	        $('a#tabNorth').removeClass("current");
	        $('a#tabRegion').addClass("current");
	        $('#mapNorth').hide();
	        $('#mapSouth').hide();
	        $('#mapRegion').show();
	    }

	    $(document).ready(function() {
	        $('a#linkNorth').click(function() {
	            showNorth();
	            return false;
	        });
	        $('a#linkSouth').click(function() {
	            showSouth();
	            return false;
	        });
	        $('a#tabNorth').click(function() {
	            showNorth();
	            return false;
	        });
	        $('a#tabSouth').click(function() {
	            showSouth();
	            return false;
	        });
	        $('a#tabRegion').click(function() {
	            showRegion();
	            return false;
	        });
	        // clear search default text on focus
	        $(".exploreSearch .input").focus(function() {
	            if (this.value == this.defaultValue) {
	                this.value = "";
	            }
	        }).blur(function() {
	            if (!this.value.length) {
	                this.value = this.defaultValue;
	            }
	        });

	        $('#textSouthTravelTip').hide();
	    });
  	
