function convertSpaces(str) {
    return str.replace(" ", "\+");
}

function doTracking(str) {
	var args = str.split("|");
	var case_str = args[0];
	var append = args[1] == undefined ? "" : convertSpaces(args[1]) ;
	
	var MLC_str = "";
	var PageName_str = "";

	switch(case_str.toLowerCase()) {	
		case "home":
			MLC_str = "/it/Fools+Gold/Home";
			PageName_str = "Home";
		break;
		
		case "synopsis":
			MLC_str = "/it/Fools+Gold/Story";
			PageName_str = "Story";
		break;	
			
		case "downloads":
			MLC_str = "/it/Fools+Gold/Downloads";
			PageName_str = "Downloads";
		break;	
			
	//video section
		case "teaser":
			MLC_str = "/it/Fools+Gold/Video";
			PageName_str = "Teaser";
		break;	
		case "trailer":
			MLC_str = "/it/Fools+Gold/Video";
			PageName_str = "Trailer";
		break;
		case "tvSpots":
			MLC_str = "/it/Fools+Gold/Video";
			PageName_str = "TV+Spot";
		break;	
		
	//about section
		case "about":
			MLC_str = "/it/Fools+Gold/About";
			PageName_str = "About";
		break;	
		case "cast":
			MLC_str = "/it/Fools+Gold/About/Cast";
			PageName_str = "Cast";
			if (append != ""){
				PageName_str = append;
				append = "";
			} //us/Fools+Gold/About/Cast/Matthew+McConaughey
		break;	
		case "crew":
			MLC_str = "/it/Fools+Gold/About/Crew";
			PageName_str = "Crew";
			if (append != ""){
				PageName_str = append;
				append = "";
			} //us/Fools+Gold/About/Crew/Andy+Tennant
		break;
		case "productionNotes":
			MLC_str = "/it/Fools+Gold/About/Production+Notes";
			PageName_str = "Production+Notes";
			if (append != ""){
				PageName_str = append;
				append = "";
			}//us/Fools+Gold/About/productionNotes/Location
		break;	
		
	//download section	
		//poster handled inside poster.html
		//wallpaper downloads handled inside wallpaper.html; previews handled below.
		case "wallpapers":
			MLC_str = "/it/Fools+Gold/Downloads";
			PageName_str = "Wallpaper+Preview";
		break;	//us/Fools+Gold/Downloads/Wallpaper+Preview+1
		
		case "gallery":
			MLC_str = "/it/Fools+Gold/Gallery";
			PageName_str = "Image";
		break;	//us/Fools+Gold/Gallery/Image+01
			
		default:
			     //MLC_str = "/us/Fools+Gold/" + case_str;
			PageName_str = case_str;
			break;	
	}
	
	if (append != "") {
		PageName_str += "+" + append;
	};

	if((PageName_str != "") && (MLC_str != "")) {
		_hbPageView(PageName_str,MLC_str);
	}
	pageTracker._trackPageview(PageName_str);
}

