$(document).ready(function(){
	//Tool Tips
	$('table span[title]').qtip({ style: { width:214, color:'#ffffff', background:'#e25a72', border:{width:1, color:'#d24f66'}, name: 'blue', tip: true}, position:{corner:{target: 'rightMiddle', tooltip: 'leftMiddle'}} })
	$('.metromap span[title]').qtip({ style: { width:214, color:'#ffffff', background:'#e25a72', border:{width:1, color:'#d24f66'}, name: 'blue', tip: true}, position:{corner:{target: 'rightMiddle', tooltip: 'leftMiddle'}} })
	//Accordion
	$(".accordion div.edukaform").hide();
	$(".accordion h4").click(function(){
	  $(this).next("div.edukaform").slideToggle("slow"); 
	  //$(this).next("div.edukaform").slideToggle("slow").siblings("div:visible").slideUp("slow");
	  $(this).toggleClass("active");
	  $(this).siblings("h4").removeClass("active");
	});
	//map details
	$(".metromap div").hide();
	$(".metromap span").click(function(){
	  $(this).next("div").show()
	  .siblings("div:visible").hide();
	  $(this).toggleClass("active");
	  $(this).siblings("span").removeClass("active");
	});
	if (".success"!=undefined){
		$(".success").closest(".accordion").prepend($(".success"));		
		setTimeout(
			function(){
				$(".success").hide("slow",function(){
					$(this).remove();
				});
				
			},5000); 
		
	}
	
	// Scroll to top of the map
	$(".pin").click(function(){
		$("html, body").animate({
			scrollTop: $(".owners").offset().top
			},
			1000);
	});	
});
