/* for the WIDGET */
hotel =  {
	
	search_by_cat: function(){
		sel = $('find_hotel').selectedIndex;
		val = $('find_hotel').options[sel].value;
		window.location = 'http://taosvacationguide.com/hotel-search/location:' + val;
	}

}

special =  {
	
	search_by_cat: function(){
		sel = $('find_special').selectedIndex;
		val = $('find_special').options[sel].value;
		window.location = 'http://taosvacationguide.com/time-for-taos/' + val;
	}
	
}

/* for the PLACES detail and sort */
placesAjax =  {
	
	sort_by_cat: function(){
		si = $('cat').selectedIndex;
		val = $('cat').options[si].value;
		window.location = '/places/view_by_cat/'+val;
	},

	load_details: function(id){
		new Effect.Fade('place-detail',{duration: .3,afterFinish: function(){
			new Ajax.Request('/places/ajax/'+id, {
				onSuccess: function(t){
					$('place-detail').update(t.responseText);
					Effect.Appear('place-detail',{duration: .6});
				}
			});
		}});
	}
	
}

/* for the CALENDAR (not currently being used) */
events =  {
	
	sort_by_cat: function(){
		si = $('event_cat').selectedIndex;
		val = $('event_cat').options[si].value;
		window.location = '/calendar/view_by_cat/'+val;
	},

	load_details: function(id){
		new Effect.Fade('event-detail',{duration: .3,afterFinish: function(){
			new Ajax.Request('/calendar/ajax/'+id, {
				onSuccess: function(t){
					$('event-detail').update(t.responseText);
					Effect.Appear('event-detail',{duration: .6});
				}
			});
		}});
	}
	
}

/* for the DISCIPLINES sort (not currently being used ) */
disciplines =  {
	
	sort_by: function(main_cat){
		
		si = $('disciplineSort').selectedIndex;
		val = $('disciplineSort').options[si].value;
		
		if(main_cat){
			window.location = '/resources/view_by_cat/'+main_cat+'/'+val;
		}else{
			window.location = '/resources/view_by_cat/'+val;
		}
		
	}
	
}

/* swap function to show detailed event in CALENDAR (legacy) */
function swapDetailedEvent(event_id){

	var curHtml = "<div class='event-detail'>" + $('calDetail_'+event_id).innerHTML + "</div>";
 	$('leftCol').update(curHtml);
	initLightbox();
	
}
