/**
 * @file
 *
 * @author Team
 * @copyright Kinetiqa GmbH
 * @version $Id$
 */


function toggle_info (that, id_show, id_hide) {
  document.getElementById (id_show).style.display = 'block';
  document.getElementById (id_hide).style.display = 'none';
  var lis = that.parentNode.parentNode.getElementsByTagName ("li");
  for (var i = 0; i < lis.length; i++) {
    if (lis[i] == that.parentNode) {
      lis[i].className = "active";
    } else {
      lis[i].className = "";
    }
  }
  return false;
};


function add_special_character(to_edit,special_char) {
    if(document.selection) {
	to_edit.focus();
	document.selection.createRange().text=special_char;
	document.selection.createRange().select();
    } else if (to_edit.selectionStart || to_edit.selectionStart == '0') {
	intStart = to_edit.selectionStart;
	intEnd = to_edit.selectionEnd;
	to_edit.value = (to_edit.value).substring(0, intStart) + special_char + (to_edit.value).substring(intEnd, to_edit.value.length);
	to_edit.selectionStart=to_edit.selectionEnd=intStart+special_char.length;
	to_edit.focus();
    } else {
	to_edit.value += special_char;
    }
}

