/*function mycarousel_itemLoadCallback(carousel, state)
{
    // Check if the requested items already exist
    if (carousel.has(carousel.first, carousel.last)) {
        return;
    }

    jQuery.get(
        'trips.php?id='+curr_trip_id+'&section=carousel',
        {
            first: carousel.first,
            last: carousel.last
        },
        function(xml) {
            mycarousel_itemAddCallback(carousel, carousel.first, carousel.last, xml);
        },
        'xml'
    );
};

function mycarousel_itemAddCallback(carousel, first, last, xml)
{
    // Set the size of the carousel
    carousel.size(parseInt(jQuery('total', xml).text()));

    jQuery('image', xml).each(function(i) {
        carousel.add(first + i, mycarousel_getItemHTML(parseInt(jQuery(this).children('id').text()),jQuery(this).children('url').text()));
    });
};
*/
/**
 * Item html creation helper.
 *//*
function mycarousel_getItemHTML(imgid, url)
{
    return '<a href="#" onclick="mycarousel_showImg(' + imgid + '); return false;"><img src="' + url + '" width="135" height="100" alt="" /></a>';
};
*/

function mycarousel_showImg(imgid) {
	$('#trip_photo').attr('src',photo_url+'/trips/'+curr_trip_id+'/'+imgid+'.jpg');
}


	function toggleLayer(whichLayer, alayer) { 
		if (document.getElementById){ 
			// this is the way the standards work 
			var style2 = document.getElementById(whichLayer); 
			var style3 = document.getElementById(alayer);
			if(style2.className=="tooldivinnerShow") { 
				style2.className = "tooldivinner"; 
				style3.className = "";
			} else if(style2.className=="tooldivinner") { 
				style2.className = "tooldivinnerShow";  
				style3.className = "adown";
			} 
		} else if (document.all) { 
			// this is the way old msie versions work 
			var style2 = document.all[whichLayer]; 
			var style3 = document.all[alayer]; 
			if(style2.className=="tooldivinnerShow") { 
				style2.className = "tooldivinner"; 
				style3.className = "";
			} else if(style2.className=="tooldivinner") { 
				style2.className = "tooldivinnerShow";  
				style3.className = "adown";
			} 
		} else if (document.layers) { 
			// this is the way nn4 works 
			var style2 = document.layers[whichLayer]; 
			var style3 = document.layers[alayer];
			if(style2.className=="tooldivinnerShow") { 
				style2.className = "tooldivinner"; 
				style3.className = "";
			} else if(style2.className=="tooldivinner") { 
				style2.className = "tooldivinnerShow";  
				style3.className = "adown";
			} 
		} 
	}
	
	function showMap(mapimg,maptitle) {
		window.open('popup.php?title='+maptitle+'&img='+mapimg,'map','width=300,height=500,scrollbars=0,resizeable=1');
	}
		
	function viewStreetMap() {
		window.location.hash = 'mapheader';
	}
	/*
	$(document).ready(function() {
	
    $('itinerary_item').click(function() {
    
      toggleLayer($(this).id);
    
    });
	
	});
	*/