function ajax_btn_content(tm, content_type){
  
  var ajaxRequest;  // The variable that makes Ajax possible!
  
  try{
    // Opera 8.0+, Firefox, Safari
    ajaxRequest = new XMLHttpRequest();
  } catch (e){
    // Internet Explorer Browsers
    try{
      ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try{
        ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e){
        // Something went wrong
        alert("Your browser broke!");
        return false;
      }
    }
  }
  // Create a function that will receive data sent from the server
  ajaxRequest.onreadystatechange = function(){
    if(ajaxRequest.readyState == 4){
      // document.myForm.time.value = ajaxRequest.responseText;
      document.getElementById('cont_'+content_type).innerHTML = ajaxRequest.responseText;
      if (ajaxRequest.responseText !='na'){
          // spage_vidbtn, spage_docbtn
        document.getElementById('spage_'+content_type+'btn').style.display = "block";
      }
      
    }
  }  
    ajaxRequest.open('GET', 'fileadmin/php/act_spage.php?tm='+tm+'&ct='+content_type);
                     ajaxRequest.send(null);
  
  
}




function spage_docbtn(){
  if(document.getElementById('cont_doc').style.display == 'none'){
    document.getElementById('cont_doc').style.display = 'block';
  }else{
    document.getElementById('cont_doc').style.display = 'none';
  }
  document.getElementById('cont_vid').style.display = 'none';
  document.getElementById('player_list').style.display = 'none';
}

function spage_vidbtn(){
  if(document.getElementById('cont_vid').style.display == 'none'){
    document.getElementById('cont_vid').style.display = 'block';
    document.getElementById('start_vid_list').style.display = 'block';
  }else{
    document.getElementById('cont_vid').style.display = 'none';
  }
  document.getElementById('cont_doc').style.display = 'none';
  document.getElementById('player_list').style.display = 'none';
}

function spage_show_player(id){
  flowplayer(id, 'fileadmin/templates/deister/ext_templates/flowplayer/flowplayer.commercial-3.1.5.swf',{key:document.getElementById('fl_licence').title}); 
  document.getElementById(id).style.display = 'block';
  document.getElementById('player_list').style.display = 'block';
  document.getElementById('start_vid_list').style.display = 'none';
}   


