$(document).ready(function(){
	$('.togglebox').remove().appendTo('#wrapper');
	//Hide the tooglebox when page load
	$(".togglebox").hide();
	//slide up and down when click over heading 2
	$(".toggle").click(function(){
	// slide toggle effect set to slow you can set it to fast too.
		$(".togglebox").slideToggle("slow");
		var url = CMSURL + "/admin/plugins/phonebook/actions/history/click-log.php";
		if (window.XMLHttpRequest){
			xmlhttp = new XMLHttpRequest();
		} else {
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		}
		xmlhttp.open("GET",url,true);
		xmlhttp.send();
		return true;
	});
	
	$(".accordion p").hide();

	$(".accordion h3").click(function(){
	
	  $(this).next("p").slideToggle("slow").siblings("p:visible").slideUp("slow");
	  $(this).toggleClass("active");
	  $(this).siblings("h3").removeClass("active");
	
	});
});

function closeToggle(){
	$(".togglebox").slideToggle("slow");
	return true;
}
