$(document).ready(function(){

	$("ul.bookers li").after("<li class=details></li>");
        $("li.details").hide();

	$("ul.bookers a.review").each(function(){
		if(!$(this).attr("href")) { 
			// remove empty reviews
			$(this).add().text('Review coming soon')
				.css('color', '#999')
				.css('background', 'transparent url(../_images/arrows/arr_empty_14.gif) no-repeat center left')
				.css('font-size', '90%');

		} else {  
			// add review for every booker
//			alert($(this).attr("href"));
			$(this).parent().next(".details").load($(this).attr("href"));
		}
	});


       	$("ul.bookers a.review").click(function () {


		if($(this).attr("href")) {
//			$(".details").load($(this).attr("href"));

			$(this).parent().next(".details").slideToggle("fast");
			$(this).toggleClass("expand");			
			
//			$(this).toggle(
			
//		 function () {
//			$(this).css('background', 'transparent url(../_images/arrows/arr_up_14.gif) no-repeat center left');
//			$(this).parent().next(".details").slideDown("fast");
//		      },
//	      function () {
//			$(this).css('background', 'transparent url(../_images/arrows/arr_down_14.gif) no-repeat center left');
//			$(this).parent().next(".details").slideUp("fast");
//			      }

//			);
			


		} 

		return false;
	});

       	$("h3 a").click(function () {

		if($(this).parent().next("ul").children(".details:eq(0)").is(':visible')) { 
			$(this).parent().next("ul.bookers").children(".details").hide();
			$(this).parent().next("ul.bookers").children("li").children("a.review").removeClass("expand");
//			$(this).parent().next("ul.bookers").children("li").children("a.review").css('background', 'transparent url(../_images/arrows/arr_down_14.gif) no-repeat center left');
		} else {
			$(this).parent().next("ul.bookers").children(".details").show();
			$(this).parent().next("ul.bookers").children("li").children("a.review").addClass("expand");
//			$(this).parent().next("ul.bookers").children("li").children("a.review").css('background', 'transparent url(../_images/arrows/arr_up_14.gif) no-repeat center left');
			$("li.details:empty").hide();
		}


		$("li.details:empty").prev("li").children("a.review").css('background', 'transparent url(../_images/arrows/arr_empty_14.gif) no-repeat center left');
		

	});




}); // document ready
