/* CARRIE UNDERWOOD */
/* Javascript: Markup Changes
-------------------------------------------------------------------------------- */


	function markup() {
	
		// KILL EMPTY TICKET SALES TAB
		if (page == "events" && $('#upcoming > div').length == 0) $('#upcoming').remove();

		// RSVP FOR FAN PARTY
		$('ul.events li a.rsvp[href=/event/fan_party/june__9_2009-5]').each(function() {
	
			$(this).remove();
	
		});
	
		if (page == "event" && topic == "june__9_2009-5" && $('#rsvp').length > 0) {
	
			$('#rsvp h3 em').remove();
			
		}
	
		// CHANGE RSVP LANGUAGE FOR FAN PARTY 09
		if (page == "event" && topic == "june__9_2009-5" && $('div#confirmation').length > 0) {
		
			//$('div#confirmation h3').text('Want to Attend?');
			$('div#confirmation .going').addClass('rsvp');
			$('div#confirmation .going').removeClass('going');
			$('div#confirmation .cant').parent().remove();
			$('div#confirmation a.maybe').parent().remove();

		
		}
		
		// NETWORK BAR EVENT LINKS
		
		if ($('#bar #nextappearances li > em').length > 0) {
		
			var link = $('#bar #nextappearances').find('a.details').attr('href');
			var text = $('#bar #nextappearances li > em').text();
			$('#bar #nextappearances li > em').remove();
			$('#bar #nextappearances ul.events > li').append('<a href="' + link + '"><em>' + text + '</em></a>');
		
		}
		
		// EDITORIAL LEADS W/THUMBNAILS
		
		$('.widget-editorial.leads ul.leads > li').each(function() {
		
			if ($(this).children('img').length > 0) $(this).addClass('hasthumb');
		
		});
		
		// RECENTLY UPDATED HEADING

		if (page == "index") $('#updated h3').text('Recently Updated Fans');
		
		// PRESALE TICKETS
		
		$('.widget-event.browse.presale').each(function() {

			$(this).find('th.starts').text('Starts');
			$(this).find('th.ends').text('Ends');

		});
		
		// FIX TABBED PAGING
		
		$('.tabbed:not(.static) > div:visible').each(function() { 
		
			pane = "#" + $(this).attr('id');
			$(this).find('ul.paging a').each(function() {
			
				var $this = $(this); 
				$this.attr('href', $this.attr('href') + pane); 
	
			});
			
		});
		
		// FIX STATIC TABBED PAGING
		
		$('.tabbed.static > div:visible').find('ul.paging a').each(function() {
		
			var tab = window.location.toString().split('tab=')[1];
			var link = $(this).attr('href').replace('?tab=' + tab,'').split('?');
			link = link[0] + "?tab=" + tab + "&" + link[1];
			$(this).attr('href', link);
		
		});
		
		// MEMBER ALIAS
		
		if (page == "blogs") $('#blog h3').prepend(alias + '\'s ');
		if (page == "site-photos") $('#photos h3').prepend(alias + '\'s ');
		
		// MARKDOWN
		
		if ($('.widget-blog.display').length > 0) $('.widget-blog.display > *:gt(2)').wrapAll('<div class="story"></div>');
		
		/* Removed javascript from browse widget because it re-sorted children by type
		$('.widget-blog.browse ul.leads > li > .post').each(function() {
		
			$(this).append('<div class="story"></div>');
			$(this).children('div.story').insertBefore($(this).children('ul.actions'));
			$(this).children('h1, h2, h3, h4:not(:first-child), h5, p, hr, ul:not(.actions), ol, table, blockquote, pre').appendTo($(this).children('div.story'));
					
		});
		*/
		
		// TOOLTIPS
		
		$('.member dl dt.comments, .lineup dl dt.comments').text('Comments');
		
		// PRESALES
		
		$('#presales .widget-event.placeholder p').each(function() {
		
			$(this).text('There are no pre-sales scheduled at this time.');
		
		});
		
		// TRUNCATE
		
		$('#shows .program ul.events li h4 span').truncate({ length: 20 });
		
		// WRAP TEXT
		
		$('#sidebar #my_moment ul.photos li h4').append('"').prepend('"');
		$('#sidebar #my_moment ul.photos li dd.member a').prepend('<em>shared by </em>');
		

/* Polls */


		$('#polls ul.paging a.next').text('Next Question');
		$('body#page-join div.success h3:contains(Voting)').next().text('Join Today to See the Results!');
	
	
/* Events */


		$('.widget-event.display dd:contains(Performance)').text('Tour Date');
		$('#page-setlistpoll .widget-event a.details').text('Choose This Event');
	
	}
	
	
	function ajaxTabMarkup() {
		
		$('tr.performance > td.details > a > em').text('Tour Date');
	
	}
