/**FUNCTION for the main jQuery parts.
 * Martin Modl.
 */
function jQueryMainFunctions() {
  jQuery(function() {
    // ------------------------------
    //runClock('clock'); //clock
    // ------------------------------ LIGHTBOX
    //jQuery('.lightbox').lightBox();
    // ------------------------------
    jQuery('.toTop').click(function() {
      jQuery('html, body').animate({scrollTop:0}, 'slow');
      return false;
    });
    // ------------------------------ SHOW/HIDE
    jQuery(".showHideID").click(function() {
      var id = jQuery(this).attr("rel");
      if(jQuery("#" + id).is(":visible")) {
         jQuery("#" + id).hide("slow");
      } else {
         jQuery("#" + id).show("slow");
      }
    });
    // ------------------------------ SHOW/HIDE class items
    jQuery(".showHideClass").click(function() {
      var id = jQuery(this).attr("rel");
      if(jQuery("." + id).is(":visible")) {
         jQuery("." + id).hide("slow");
      } else {
         jQuery("." + id).show("slow");
      }
    });
    // ------------------------------ HINTS behind the icons at the level of form fields
    jQuery(".hintLink").click(function() {
      var id = jQuery(this).attr("rel");
      if(jQuery("#" + id).is(":visible")) {
         jQuery("#" + id).hide("slow");
      } else {
         jQuery("#" + id).show("slow");
      }
    });
  });
}

//FUNCTION removes the appended form field.
function removeFormField(id) {
  jQuery(id).remove();
}

/**FUNCTION redirect the site to the target site after confirm.
 * Martin Modl.
 */
function confirmation_redirection(url, text) {
  var question = confirm(text);
  if (question == true) {
    window.location.href = url;
  }
}

/**FUNCTION shows and hides the id html tag.
 *Martin Modl.
 */
function showHideID(id) {
  //var display = (document.getElementById(id).style.display == 'none') ? 'block' : 'none';
  //document.getElementById(id).style.display = display;
  if(jQuery("#" + id).is(":visible")) {
     jQuery("#" + id).hide("slow");
  } else {
     jQuery("#" + id).show("slow");
  }
}
