
function ajaxAddEventItinJQuery(eventid)
{
	var thisUrl  = imgroot+'/itinerary/index.cfm';
	var thisData = 'action=ajax_addEventItin&eventid='+eventid; 

	$.ajax({
	   type: "POST",
	   url: thisUrl,
	   data: thisData,
	   success: function (response){
			//$('#itin_' + listingid).html('<a href="'+imgroot+'/itinerary/">View Itinerary</a>');
			$('#itinEvent_' + eventid).html('<a href="'+imgroot+'/itinerary/"><img src="' + imgroot + '/includes/images/calendar_link_added-to-itinerary.gif" alt="" /></a>');
			updateItin();
		},
	   failure: handlerFailuer
	 });
}


function updateItin(){
	//$('itinImage').src = '../images/iconItineraryBlue.gif';
	$.get(imgroot + '/includes/cftags/itinerary/itineraryDisplay.cfc', {method: "getCount",avoideCatch: myTimestamp()},
		function(data){
			$('#itinCount').html("");
			$('#itinCount').html(data);
		}
	);
}

function ajaxAddCouponJQuery(couponid)
{
	var thisUrl  = imgroot+'/itinerary/index.cfm';
	var thisData = 'action=ajax_addCouponItin&couponid='+couponid;
	thisData += '&avoideCatch=' + myTimestamp(); 

	$.ajax({
	   type: "POST",
	   url: thisUrl,
	   data: thisData,
	   success: function (response){
			$('#itinCoupon_' + couponid).html('<span class="addeditin">Added to Itinerary</span>');
			updateItin();
		},
	   failure: handlerFailuer
	 });
}


function ajaxAddItinJQuery(imgroot,listingid)
{
	var thisUrl  = imgroot+'/itinerary/index.cfm';
	var thisData = 'action=ajax_addItin&listingid='+listingid; 

	$.ajax({
	   type: "POST",
	   url: thisUrl,
	   data: thisData,
	   success: function (response){
			//$('#itin_' + listingid).html('<a href="'+imgroot+'/itinerary/">View Itinerary</a>');
			$('#itinListing_' + listingid).html('<a href="'+imgroot+'/itinerary/"><img src="' + imgroot + '/includes/images/listings_link_added-to-itinerary.gif" alt="" /></a>');
			updateItin();
		},
	   failure: handlerFailuer
	 });
}

function handleSuccess(response)
{
	document.body.innerHTML = response.responseText;
			return false;
}

function handlerFailuer(response)
{
	alert(response);
}

function myTimestamp(){
    tstmp = new Date();    
    return tstmp.getTime();
} 
