jQuery.noConflict();

function loadDestinationInfo() {
		var	visited_countries = jQuery("#vcountries").val();
		var ajax_url = '/product-destinations' + visited_countries;
		//alert(ajax_url);
		
		jQuery("#destinfo_heading").addClass("loading");
		jQuery("#destinfo_heading").html("Loading destination info, please wait...");
		/*
		jQuery("#destinfo_content").load(ajax_url, function () {																															
			jQuery("#destinfo_heading").html("Destination Info");
			jQuery("#destinfo_heading").removeClass("loading");
		});
		*/
		jQuery.ajax({
				url: ajax_url,
				/*cache: false,*/
				success: function(html){
					
					jQuery("#destinfo_heading").html("Destination Info");
					jQuery("#destinfo_heading").removeClass("loading");
					
					// clear last text
					jQuery("#destinfo_content").html("");
					
					// insert current tex
					jQuery("#destinfo_content").append(html);

/*
					// create accordion
					jQuery('#accordions').accordion({
						autoheight: false,
						active: true
					});
					
					if (jQuery("#accordions").children("a").length == 1) {
						jQuery("#accordions").accordion("activate", 0);
					}
*/

					// non-standard accordions-like implementation

					if (jQuery("#accordions").children("a").length > 1) {
						jQuery("#accordions > div").hide();  
						jQuery("#accordions > a").click(function() {
							var a = jQuery(this);
							var nextDiv = jQuery(this).next();
							var visibleSiblings = nextDiv.siblings("div:visible");
					 
							if (visibleSiblings.length ) {
								visibleSiblings.slideUp("fast", function() {
									jQuery("#accordions > a").removeClass("selected");
									a.addClass("selected");
									jQuery(window).scrollTop(0);
									nextDiv.slideDown("fast", function() {
									});																									
								});
							} else {
									if (a.hasClass("selected")) {
										nextDiv.slideUp("fast", function() {
											a.removeClass("selected");	
											jQuery(window).scrollTop(0);
										});
									} else {
										jQuery(window).scrollTop(0);
										a.addClass("selected");											
										nextDiv.slideDown("fast", function() {
										});
									}
							}
						});
					} else {
						jQuery("#accordions > a").addClass("selected");
					}
				}
			});
}

