// JavaScript Document
		var userID;
		var accessToken;
		var whosGoingUrl;
		var url;
		var returnParam;

		$(document).ready(function() {
			getEventDates();
			if(checkIfValid(window.eventID)){
				try{
					if(checkIfValid(window.twitterWidgets) && checkIfValid(window.mediaWidgets)){
						if($('#PackageModule').length == 0 && checkIfValid(twitterWidgets.length) && checkIfValid(mediaWidgets.length) && $('#FlexModule_Left').length == 0){
							$('#twitterModules .contentArea').css('height',478);
						}
					}
				
				}catch(error){}
			}
		
			// BUILD TABS//
			
			try{
			if(checkIfValid(window.mediaWidgets)){
				$.each(mediaWidgets, function() {
					if(String(this) !== ""){
						$("#MediaModule-content ul").append('<li><a href="#'+this.split(" ").join("")+'">'+this+'</a></li>');
						$("#MediaModule-content .contentArea").append('<div id="'+this.split(" ").join("")+'"></div>');
						switch(String(this.split(" "))){
							case 'Audio':
							if(amazonID){
								addAmazonPlayer('#Audio',amazonID);
							}
							break;
							case 'Video':
							if(youtubeID){
								addYoutubePlayer("#Video",youtubeID);
							}
							break;
							case 'Gallery':
							if(picasaID){
								addPicasaGallery('#Gallery',picasaID);
							}
							break;							
						}
						}
					});
					
			}else{
				$('#MediaModule').remove();
			}
			}catch(error){}
			
		try{
		if(checkIfValid(window.leftSocialWidgets) && (leftSocialWidgets[0]!="" || leftSocialWidgets[1]!="")){
				$.each(leftSocialWidgets, function() {
					if(String(this) !== ""){
						$("#SocialModule_Left-content ul").append('<li><a href="#'+this.split(" ").join("")+'">'+this+'</a></li>');
						$("#SocialModule_Left-content .contentArea").append('<div id="'+this.split(" ").join("")+'"></div>');
							switch(String(this)){
								case 'Comments':
								addComments();
								break;
								case 'Sweeps':
								addSweeps();
								break;
								
							}
						}
					});
			}else{
				$('#SocialModule_Left').remove();
			}
		}catch(error){}
		try{
		if(checkIfValid(window.twitterWidgets)){
				$.each(twitterWidgets, function() {
					if(String(this) !== ""){
						var tID;
						if(this["ID"].search("@") !== -1){
								tID=this["ID"].split("@")[1];
							}else{
								tID=this["ID"]
							}
						$("#twitterModules-content ul").append('<li><a href="#'+tID+'">'+this["TITLE"]+'</a></li>');
						$("#twitterModules-content .contentArea").append('<div class="overview" id="'+tID+'"></div>');
						addTwitterFeed("#"+tID, tID);
						}
					});
			}else{
				$('#twitterModules').remove();
			}
		}catch(error){$('#twitterModules').remove();}
		try{
		if(checkIfValid(window.eventID)){	
			if($("#otherEventModule").find("li").length > 1){
					$("#otherEventModule").easySlider({
						controlsBefore:	'<p id="controls">',
						controlsAfter:	'</p>',
						prevText: 'Previous',	
						nextText: 'Next',
						auto: false, 
						continuous: false
					});
				}
			if($("#stayAndPlay").find("li").length > 1){
					$("#stayAndPlay").easySlider({
						controlsBefore:	'<p id="controls2">',
						controlsAfter:	'</p>',	
						prevId: 'prevBtn2',
						nextId: 'nextBtn2',
						prevText: 'Prev Package',	
						nextText: 'Next Package',
						auto: false, 
						continuous: false
					});
				}
			}
		}catch(err){}
	
			$.getScript('/javascript_includes/2011_templates/jquery.ui.tabs.js', function() {
				$(".tabs").tabs();
			});
			
			$('div.expandable').each(function(){
				 var tempHTML = $(this).html();
					$(this).html(tempHTML.split('<br><br>').join('</p><p>'));
					tempHTML = $(this).html();
					$(this).html(tempHTML.split('<br /> <br />').join('</p><p>'));
					tempHTML = $(this).html();
					$(this).html(tempHTML.split('<br/><br/>').join('</p><p>'));
					tempHTML = $(this).html();
					$(this).html(tempHTML.split('<br> <br>').join('</p><p>'));
					tempHTML = $(this).html();
					$(this).html(tempHTML.split('<br /><br />').join('</p><p>'));
					
					
					
					if (showState != "M") {				
						if($(this).find('p').length >1){
							$(this).find('p:first').nextAll('p').hide();
							$(this).append('<div class="expandAndClose"></div>');								
							$(this).find('.expandAndClose').html('<div class="read-more"><a href="javascript:void(0);">Show More<img src="/images/Property/clv/navElements/expandImage.gif" width="13" height="13" border="0"/></a></div><div class="re-collapse" style="display:none;"><a href="javascript:void(0);">Show Less<img src="/images/Property/clv/navElements/collapseImage.gif" width="13" height="13" border="0"/></a></div>');
						}
					} else {
						$(this).append('<div class="expandAndClose"></div>');								
						$(this).find('.expandAndClose').html('<div style="display:none;" class="read-more"><a href="javascript:void(0);">Show More<img src="/images/Property/clv/navElements/expandImage.gif" width="13" height="13" border="0"/></a></div><div class="re-collapse"><a href="javascript:void(0);">Show Less<img src="/images/Property/clv/navElements/collapseImage.gif" width="13" height="13" border="0"/></a></div>');

					}
				
			});
			
			
			
			$("div.expandable .read-more a").click(function(){
					$(this).parent().parent().parent().find('p:first').nextAll('p').show();
					$(this).parent().siblings('div').show();
					$(this).parent().hide("slow");
				});
				
			$("div.expandable .re-collapse a").click(function(){
				$(this).parent().parent().parent().find('p:first').nextAll('p').hide();
				$(this).parent().hide();
				$(this).parent().siblings('div').show();
			});
			
			
		if(window.eventID !== undefined){
				buildSlideShow("EventHero");
				addTwitterShare();
				addLikeButton('like');
				connectToFacebook();
				addGooglePlusOne();
			}
	
				
		});
		
		//function to hide Other Entertainment module if date is in the past.
		function checkDateNotInPast(obj,div)
		{
			var vDate = Date.parse(obj,div);
			var today = new Date().getTime();
			if(vDate < today)
			{
				dateObj = obj.split("/");
				
				$("." + div + "").hide();
			}
			
		}
