if (document.RINPOCHE == undefined) {
	
	RINPOCHE = {};
}

RINPOCHE.india = function() {
	
	var obj = {};
	
	var sections = ['overview','itinerary','details','join'];
	
	var visibleSection = 'overview';
	
	obj.setupPage = function() {
		
		// hide the page contents
		$("#itineraryContent").css('display', 'none');
		$("#detailsContent").css('display', 'none');
		$("#joinContent").css('display', 'none');
		
		$(sections).each(function(i,section) {
			
			var button = $("#"+section+"Button a")[0];
			
			button.removeAttribute("href");
		});
		
		obj.addEvents();
	};
	
	obj.addEvents = function() {
		
		$("#indiaNav").bind("click",function(e){
			
			if ((e.target.id != 'indiaNav') && ((e.target.id != "printButton") || (e.target.parentNode.id != "printButton"))) {
			
				$(sections).each(function(i,section) {
				
					var isActiveSection = ((e.target.id == section+"Button") || (e.target.parentNode.id == section+"Button")) ? true : false;
				
					$("#"+section+"Button").get()[0].className = (isActiveSection) ? 'indiaNavOn' : '';
				
					if (isActiveSection) {
						
						$("#"+section+"Content").show("fast");
						
						visibleSection = section;
						
					} else {
						
						$("#"+section+"Content").hide("fast");
					}
				});
			}
		});
	}
	
	return obj;
	
}();