
function changeCardField(name, value)
{
  var field = document.getElementById('card_'+name);
  field.innerHTML = value;
}

function changeCardImage(cardnr)
{
  var input = document.getElementById('cardnr');
  input.value = cardnr;
  input.onchange();
}

function changeCardTextColor(color)
{
  var mycss = getCSS(0);
  
  mycss[0].style.color = color;
}

function prepareEditBlogForm(blogId)
{
  theForm = document.getElementById('blog_submit_form');
  
  theForm['blog_id'].value         = blogId;
  theForm['blog_item_title'].value = document.getElementById('blog_'+blogId+'_title').innerHTML;
  theForm['blog_item_text'].value  = document.getElementById('blog_'+blogId+'_text').innerHTML;
}

function deleteBlogItem(blogId)
{
  theForm = document.getElementById('blog_submit_form');
  
  theForm['blog_id'].value     = blogId;
  theForm['blog_action'].value = "remove";
  theForm.submit();
}

function prepareEditMovieForm(movieId)
{
  theForm = document.getElementById('movie_submit_form');
  
  theForm['movie_id'].value      = movieId;
  theForm['movie_title'].value   = document.getElementById('movie_'+movieId+'_title').innerHTML;
  theForm['movie_comment'].value = document.getElementById('movie_'+movieId+'_comment').innerHTML;
  theForm['movie_url'].value     = document.getElementById('movie_'+movieId+'_url').innerHTML;
}

function deleteMovieItem(movieId)
{
  theForm = document.getElementById('movie_submit_form');
  
  theForm['movie_id'].value     = movieId;
  theForm['movie_action'].value = "remove";
  theForm.submit();
}

function prepareEditAgendaForm(agendaId)
{
  theForm = document.getElementById('agenda_submit_form');
    
  theForm['agenda_id'].value          = agendaId;
  theForm['agenda_title'].value       = document.getElementById('agenda_'+agendaId+'_title').innerHTML;
  theForm['agenda_description'].value = document.getElementById('agenda_'+agendaId+'_description').innerHTML;
  theForm['agenda_date'].value        = document.getElementById('agenda_'+agendaId+'_date').innerHTML;
}

function deleteAgendaItem(agendaId)
{
  theForm = document.getElementById('agenda_submit_form');
  
  theForm['agenda_id'].value     = agendaId;
  theForm['agenda_action'].value = "remove";
  theForm.submit();
}

function prepareEditReactionForm(reactionId)
{
  theForm = document.getElementById('reaction_submit_form');
  
  theForm['reaction_id'].value   = reactionId;
  theForm['reaction_text'].value = document.getElementById('reaction_'+reactionId+'_text').innerHTML;
}

function deleteReactionItem(reactionId)
{

  theForm = document.getElementById('reaction_submit_form');
  theForm['reaction_id'].value     = reactionId;
  theForm['reaction_action'].value = "remove";
  theForm.submit();

}

function deleteLinkItem(linkId)
{
  theForm = document.getElementById('link_form');
  
  theForm['link_id'].value     = linkId;
  theForm['link_action'].value = "remove";
  theForm.submit();
}
