
/*===============================================================================
	affiliate.js
	John Larson
	3/32/08
	
	All page-specific JavaScript for calendar.asp

===============================================================================*/


window.addEvent('domready', function() {
	
	dbug.enable();
	
	gigDetailsPopUp = new PopUpWindow('Event Details',
		{injectLocation: $('gigDetailsInjectDiv'),
		 width: '312px', left: '-300px', top: '-30px'});
	
	mapPopUp = new PopUpWindow('Map',
		{injectLocation: $('mapInjectDiv'), contentDiv: $('mapDiv'),
		 width: '500px', left: '250px', top: '-250px'});
	
	
	var descriptionDiv = $E('.description_table');
	var description = descriptionDiv.innerHTML;
	description = description.replace(/(\bhttp:\/\/[^< ]+)\b/, '<a href=\"$1\">$1</a>');
	descriptionDiv.setHTML(description);
});
	

/*********************************************************************************
/ SECTION::View Gig Details Pop Up
*/
	function makeListingGigsClickable() {
		$$('.gigListingRow').each(function(theGig) {
			var thisID = theGig.id.substring(6);
			theGig.addEvent('click', function() {
				loadGigDetails(thisID);
			});
		});
	}
	
	function loadGigDetails(GigID) {
		showLoad();
		new Ajax('AJAXLoad.asp?l=loadGigDetails', {
			method: 'post',
			data: 'GigID=' + GigID,
			update: gigDetailsPopUp.getContentDiv(),
			evalScripts: true,
			onComplete: function() {
				gigDetailsPopUp.open();
				hideLoad();
			}
		}).request();
	
	}
	
// End SECTION::View Gig Details Pop Up
/********************************************************************************/


	function showMap() {
		mapPopUp.open();
	}