submitForm  = function( formID )
{
  $('form#'+formID).submit();
}

strToTrim = function( stringToTrim )
{
  return stringToTrim.replace(/^\s+|\s+$/g,'');
}

isEmpty = function( val )
{
  if( strToTrim( val ) == '' ) return true;
  else return false;
}

CFsendQuestionForm  = function()
{
  var error     = false;
  var nickname  = $('#nickname');
  var textform  = $('#textform');
  var mail      = $('#mail');

  if( isEmpty( nickname.val() ) )
  {
    error = true;
    nickname.addClass('inErr');
  } else nickname.removeClass('inErr');

  if( isEmpty( textform.val() ) )
  {
    error = true;
    textform.addClass('inErr');
  } else textform.removeClass('inErr');

  if( isEmpty( mail.val() ) )
  {
    error = true;
    mail.addClass('inErr');
  } else mail.removeClass('inErr');

  if( error ) return false;
  else submitForm('sendQuestionForm');
}

wyprawy = function() {
  oDiv = document.getElementById('wyprawyBox');
  oDiv.style.display    = "block";
  oDiv.style.visibility = "visible";

  oDiv.style.left = $('#wyprawyLink').position().left + "px";
  oDiv.style.top  = $('#wyprawyLink').position().top - 90 + "px";
}

