function browse(file)
{
 //$('ajax_loader').style.display = 'block';
 var exec = {
   method:'post',
   postBody:'' ,
   onSuccess: function(response) {
      $('content').innerHTML = response.responseText;

          //$('ajax_loader').style.display = 'none';
     }
  };
new Ajax.Request('pages/'+file+'.php', exec);
}

function phpexec(file, pbody)
{
 $('ajax_loader').style.display = 'block';
 var exec = {
   method:'post',
   postBody:pbody ,
   onSuccess: function(response) {
      if(response.responseText != 'ok')
		eval(response.responseText);
	  $('ajax_loader').style.display = 'none';
     }
  };
new Ajax.Request('serv/'+file+'.php', exec);
}

function contact_send()
{
	var betreff = $('betreff').value;
	var text = $('text').value;
	betreff = betreff.replace(/&/, "%hint_and_hint%");
	text = text.replace(/&/, "%hint_and_hint%");
	phpexec('contact', 'betreff='+betreff+'&text='+text);
}

function do_login()
{
	var postbody = 'username='+$('login_username').value+'&userpass='+$('login_userpass').value;
	//alert('Test-Output Postbody: '+postbody);
	phpexec('login', postbody);
}

function do_logout()
{
	phpexec('logout', '');
}

function delete_file(path)
{
	postbody = 'filepath='+path;
	phpexec('delete_file', postbody)
}

function ffztyp_check()
{
	if($('kurstyp').value == 'FFZ')
	{
		$('ffz_jahr').style.display = 'block';
		$('ffz_ferien').style.display = 'block';
	}
	else
	{
		$('ffz_jahr').style.display = 'none';
		$('ffz_ferien').style.display = 'none';
	}
}

