/*****************************************************************/
/*****************************************************************/
/* Das Script zum Füllen der Inhalte auf der FAQ-Seite.          */
/*****************************************************************/

	var allgemeinefaqs = Class.create();
	allgemeinefaqs.prototype = {
		data:[],
		aktuellerpart: null,
		reiseid:null,
		aktuellerinhalt: null,
		
		initialize: function () {},
		
		ladefaq:function (detailid,detailbereich)
		{
			if (!detailbereich)
				detailbereich = "portal";
			if (detailbereich)
			{
				$("spinner").show();
				var showFaq = this.showFaq.bind(this);
				var url    = 'ajaxdetail.php';
				var params = {bereich:"faq", part:detailbereich, id:detailid};
				var myAjax = new Ajax.Request( url, {method: 'POST', parameters: params, onComplete: showFaq} );
			}
		},
		showFaq:function(request)
		{
			$("spinner").hide();
			if (request.responseText)
			{
				
				faqdata = eval('(' + request.responseText + ')');
				var hinein = "<h3 class=\"faq\">"+faqdata.title+"</h3><dl>";
				
				faqdata.fragen.each(function(faq) {
					
						hinein += "<dt class=\"faqfrage\"   id=\"faqfrage_"+ faq.id +"\" onclick=\"faqtextzeigen(this, '"+ faq.id+"')\" onmouseover=\"hover(this,true);\" onmouseout=\"hover(this, false);\">"+ faq.frage +"</dt>";
						hinein += "<dd class=\"ausblenden\" style=\"display:none;\" id=\"faqantwort_"+ faq.id +"\">"+ faq.antwort +"</dd>";	
						});
				hinein += "</dl>";
				
				$('faqfragen').update(hinein);
				
			}
		}
	};


