// javascript for activities/ajax

function addActivity(theActivityId){

	dojo.io.bind({
				url:'/addActivityToBucket.ha',
				content: {
					activityId: theActivityId					
				},
				method:'post',
				load: function(type, data, evt){

				  displayBucketAdd(data);
				  
				},
    			mimetype: "text/plain"
				});

				document.getElementById('addButton-'+theActivityId).innerHTML="";
				
				
				var holder = "<a href='javascript:;' "
				holder += "onclick=";
				holder +="deleteActivity("; 
				holder += theActivityId
				holder += ");";
				holder += " class='normal'>";
				holder += "remove</a>&nbsp;";
				
				
				document.getElementById('removeLink-'+theActivityId).innerHTML = holder;

}

function deleteActivity(theActivityId){
	dojo.io.bind({
		url:'/deleteActivityFromBucket.ha',
		content: {
			activityId: theActivityId
		},
		method:'post',
		load: function(type, data, evt){
		  displayBucketRemove(data);
		},
		mimetype: "text/plain"
		});

		document.getElementById('addButton-'+theActivityId).innerHTML="<a href='javascript:;' onclick='addActivity("+theActivityId+"); '><span>Add +</span></a>";
		document.getElementById('removeLink-'+theActivityId).innerHTML = ""
}

function setActTypeDesc(actTypeId, actTypeName) {

	var headerText="";
	var descText="";

	if (actTypeId>0) {
		headerText = actTypeName;
		descText = getActTypeDesc(actTypeId);
	}
	else {
		headerText="What's an activity?";
		descText="Activities are free, fun ways to enjoy and learn more about a site or destination. Roll-over the icons above for descriptions of some of our activity types. Click to see activities of that type.";
	}
	
	// change the header
	var headerField = document.getElementById('actTypeHeader');
	if (headerField) {
		headerField.innerHTML = headerText;
	}

	// change the desc
	var descField = document.getElementById('actTypeDesc');
	if (descField) {
		descField.innerHTML = descText;
	}
}

function getActTypeDesc(actTypeId) {
	var retVal = "";
	//alert('actTypeId:' + actTypeId);
	switch (actTypeId) {
		case 450: // Scavenger Hunt
			retVal="Hunt for clues and artifacts related to a theme or story unique to your destination. With each find, another piece of the puzzle falls into place, and your understanding of the destination grows.";
			break;
		case 452: // Site Doing (See and Do)
			retVal="Engage in your destination! Fun games and exercises suggest ways to get \"up close and personal\" with a site's or a destination's unique history and culture, and promise to make your visit one that you'll remember.";
			break;
		case 454: // Along for the Ride
			retVal="Transport yourself off the tourists' beaten path! Ride a double-decker bus in London, a bike in Beijing, or a \"tuk-tuk\" in Bangkok. Learn how the locals travel and how to ride along with them.";
			break;
		case 455: // Architecture Abounds
			retVal="Build your knowledge of a destination's architectural styles. Explore hidden catacombs and dungeons, climb steeples and towers, and navigate through the buildings that make your destination distinctive--or investigate the engineering that makes them functional.";
			break;
		case 456: // Art Historian
			retVal="Be an art historian and immerse yourself in the art and music that make a destination either timeless or frozen in time. These activities engage you with the where, who, what, how, and why of great art.";
			break;
		case 457: // Artist in Residence
			retVal="Create in the presence of greatness! Bring art materials to the museum to copy images of artwork or use famous artwork as inspiration for your own unique masterpiece using supplies available on the H&A website.";
			break;
		case 458: // Create Your Own HAActivity Type
			retVal="There's always a new way to get people excited about the life of a city or place, and this is the category for all of the activities that don't properly fit any of the other categories.";
			break;
		case 459: // Documentaries
			retVal="Create a unique and informative documentary with photos, videos, interviews, and/or collected tokens of your visit to share what you've seen and learned with your family and friends. Focus on a theme to make your documentary unforgettable.";
			break;
		case 460: // Planet Earth
			retVal="Interested in science? The environment? Ecology and nature? These activities investigate the environmental and scientific issues affecting a destination. Take a nature hike, perform experiments, and explore indigenous plants, trees, bugs, and other wildlife.";
			break;
		case 461: // Edutainment
			retVal="Let the good times roll at local amusement parks, street fairs, and kid fun centers. How do kids have fun around the world? Visit local sporting events, and learn to play new games on your own.";
			break;
		case 462: // Fashion Show
			retVal="Unleash your sense of style with activities focusing on fashion trends from haute couture to vintage clothes. Go shopping with the locals, plan a fashion show, and bring your destination's flair for fashion to life.";
			break;
		case 463: // Global Math
			retVal="Put your calculating powers to work for you in your destination. Go shopping, buy tickets, or exchange money and learn about local currency, keeping a travel budget, and bartering techniques at local shops and markets.";
			break;
		case 464: // History's Mysteries
			retVal="Get on the trail and uncover the clues to unlock history's mysteries. Look for objects, symbols, buildings, signs, or other meaningful clues to the history of a site or destination.";
			break;
		case 465: // Lifestyles of the Famous
			retVal="Follow in the footsteps of the figures that helped put your destination on the map using activities that get travelers involved in the stories of these celebrities' lives and creations.";
			break;
		case 466: // Manipulative Kits
			retVal="Get hands-on experience using your new knowledge of an area's art, architecture, and more by completing kits to create models or other handiwork.";
			break;
		case 467: // Lay of the Land
			retVal="Navigate the local geography and discover why the city was built where it was and how the local landscape affects it with activities that use maps and mapmaking to help you find a destination's geographical heart.";
			break;
		case 468: // Markets
			retVal="Immerse yourself in the sights, sounds, and flavors of local culture at the market. Sample new foods, discover local crafts, participate in local buying and selling rituals, and get involved with local artisans.";
			break;
		case 469: // Masters and Masterpieces
			retVal="Why did Leonardo da Vinci paint the Mona Lisa? Become a master artist by giving first-person accounts of artists' place within art history. Discover different art periods and styles, and create your own artistic masterpieces.";
			break;
		case 470: // Meet and Greet
			retVal="Speak the local lingo, make new friends, and get \"under the surface\" of your destination, whether it is foreign or not. Learn new phrases to say hello, share basic information, and interact with locals.";
			break;
		case 471: // Music Maestro
			retVal="Find the local rhythm and get into the groove of your destination by attending a local musical production, learning about local musical instruments and local musicians, or by making some music of your own.";
			break;
		case 472: // Prose and Poetry
			retVal="Check out the local literati. Discover the writers of the moment as well as the masters of the past, and get inspired to write about the new places you've experienced and the people you've met.";
			break;
		case 473: // Role-Playing
			retVal="Become a famous historical figure, an archeologist, or a tour guide for a change and get inside the local scene. Simple scripts and ideas help you stage your own play, dance, or show.";
			break;
		case 474: // Stamps and Letters
			retVal="Stamps express a destination's unique culture. These activities show you how, by using stamps from around the globe, and by helping you create postcards postmarked with your own creativity and style for families, friends, and fellow travelers.";
			break;
		case 475: // Steeples and Naves
			retVal="Expand your understanding of world religions by learning basic principles and practices of local religions and courteously observing rites or ceremonies. Discover how different religions affect and reflect the culture and society of a destination.";
			break;
		case 476: // Taste It, Make It
			retVal="Savor the local flavors. Learn how and where the locals buy their ingredients, how to use new cooking utensils and techniques, and how to present the meal to your guests like a true native!";
			break;
		case 477: //The Webmaster
			retVal="Send photos or drawings through the Internet or set up a web page of your trip for family, friends, and fellow travelers to view. Or, create activities that focus on technological aspects of your destination.";
			break;
		case 478: //The World Stage
			retVal="Attend a performance or give your own! Find performances that illuminate local culture, from concertos in Prague to dance in Turkey or movie productions in Hollywood. Or, put on your own show for your family.";
			break;
		case 479: //Tour Guide
			retVal="Take your family on a tour they won't forget! Learn facts about the destination site and impress your friends and family with your specialized local knowledge, or design a trivia game for the whole family.";
			break;
		default:
			//alert('got:' + actTypeId);
			break;
	}
	
	return retVal;
	
}









