var godo = {
    init: function(){
    	if (params.isProduct) {
    		godo.addtocart.init();
    		godo.calendar.init();
    	}
  		godo.filters.init();    	
        $(document).ready(function(){

            // Search button
            $("#submit").click(function(event) {
                event.preventDefault();
                var location = $("#locationkeyword").val();
                var activity = $("#activitykeyword").val();
                // If a user has free text searched then need to retrieve from display field
                if (location.length == 0) location = $("#locationkeyworddisplay").val();
                if (activity.length == 0) activity = $("#activitykeyworddisplay").val();
                
                var url = "";
                if (activity.length > 0 && (activity !== "Anything")) {
                    url += "experience-" + activity;                    
                }
                if (location.length > 0 && (location !== "Anywhere")) {
                    if (url.length > 0) {
                        url += "-";
                    }                
                    url += "activities-in-" + location;
                }                
                
                // Replace spaces with dashes and make lower case before redirecting
                url = "/" + url.toLowerCase().replace(/ /g, "-");
                
                // GO!               
                window.location.href = url;
            });
            
        });
            
    }
}
