jQuery(function() {
	
	jQuery('#show_all').toggle(
			function() {
	
				jQuery('.toggleview').css('display','block');
				jQuery('#show_all').html('weniger anzeigen');
	
			},
			function() {
				
				jQuery('.toggleview').css('display','none');
				jQuery('#show_all').html('alle anzeigen');
				
			}
	);
	
	jQuery('#readmore a').click(function() {
		
		jQuery('#readmore').html('<p>wird geladen ...</p>');
		
		var postdata = "id=" + jQuery("#locationid").val();
		
		jQuery.ajax({
			
			type: "POST",
			timeout: 5000,
			data: postdata,
			dataType: "json",
			url: "/api/locationmore/",
			error: function(xhr) {
				
				jQuery('#readmore').html(' ');
				//alert(xhr.responseText);
			
			},
			success: function(data) {
			
				//alert(data.Appointment.text);
			
				jQuery('#readmore').html('' + data.Location.text + '');
			
				/*
			
				jQuery("#Termin-senden img").attr("src","/kcaptcha/" + (Math.floor(Math.random()*10000001) + 10000000) + ".jpg");
				
				if(data) {
					
					jQuery("#Termin-senden").slideUp(1000,function() {
					
						for(i=0;i<validate.length;i++) {
							
							validate[i]["obj"].val("");
							
						}
					
					});
					
				} else {
				
					jQuery("#Termin-senden input:eq(4)").val("");
					validate[5]["obj"].css("border","1px solid #990000");
					jQuery("#Artikel-senden-error").append(validate[5]["message"]);

					validate[5]["obj"].focus();
					
				}
				*/
			}
			
		});
	
	});
	
});
