/*
	Copyright by: CAUCHY_fry
	Date: April 2009
	Support: www.fry-funclan.com
	
	This document needs the prototype-library!
	
	This document is licenced under BSD-licence
*/

function initalize_ajax() {
 /*info_spieler();*/
 refresh_post();
 aktualisiere_faston();
}

function info_spieler() {
 var myAjax = new Ajax.PeriodicalUpdater('tracker',
					'include/boxes/aatracker_abfrage.php', 
					{frequency: 300, decay: 1.5})
}

function klappentext(id) {
	with($(id).style) {
	 if(display=="none") {
	  display="inline";
	 }
	 else {
	  display="none";
	 }
	}
}

function send_post() {
 $('indicator').style.display = '';
 $('ausgabe').style.display = 'none';
 var obj = 'shoutbox_nickname='+document.getElementsByName('shoutbox_nickname')[0].value+'&shoutbox_textarea='+encodeURI(escape(document.getElementsByName('shoutbox_textarea')[0].value));
 var obj2 = obj+'&shoutbox_zugang=okay&shoutbox_submit=absenden';
 var myAjax = new Ajax.Request("include/boxes/shoutbox.php", 
   { parameters: obj2, 
   onComplete: zeige_posts}); 
 document.eingabe.reset();
}

function refresh_post() {
 var myAjax = new Ajax.PeriodicalUpdater(
   {success: 'ausgabe'}, 'include/boxes/shoutbox.php', 
   {frequency: 30, parameters: {shoutbox_zugang:'okay'}});
}

function zeige_posts ( originalRequest ) {
 $('indicator').style.display = 'none'; 
 $('ausgabe').style.display = '';
 $('ausgabe').update( originalRequest.responseText );
}

function aktualisiere_faston() {
 var myAjax = new Ajax.PeriodicalUpdater(
  {success: 'faston'}, 'include/boxes/faston.php',{frequency: 50, parameters: {faston_erneut:'ja'}}
 );
} 
