/* © by WebMentor (www.webmentor.de) */


ie = ie7 = ie8 = kq = nn = nn6 = opr = false;
browser_all = document.all;
browser_dom = document.getElementById;
if (document.ids) { br = 'nc4'; }
else if (browser_all && !browser_dom ) { br = 'ie4'; ie = true; }
else if (window.opera && !document.createElement ) { br = 'op5'; opr = true; }
else if (window.opera && window.getComputedStyle) {
  if (document.createRange) { br = 'op8'; }
  else if (window.navigate) { br = 'op7.5'; }
  else { br = 'op7.2'; }
  opr = true;
}
else if (window.opera && document.compatMode) { br = 'op7'; opr = true; }
else if (window.opera && document.releaseEvents) { br = 'op6'; opr = true; }
else if (document.contains && !window.opera) { br = 'kq3'; kq = true; }
else if (window.pkcs11 && window.XML) { br = 'f15'; nn = true; nn6 = true; } //firefox
else if (window.getSelection && window.atob) { br = 'nn7'; nn = true; nn6 = true; }
else if (window.getSelection && !document.compatMode) { br = 'nn6'; nn = true; nn6 = true; }
else if (window.clipboardData && document.compatMode) {
  if (document.querySelectorAll) { br = 'ie8'; ie8 = true; }
  else if (window.XMLHttpRequest) { br = 'ie7'; ie7 = true; }
  else { br = 'ie6'; }
  ie = true;
}
else if (window.clipboardData) {
  br = 'ie5';
  if (!document.createDocumentFragment) { br += '.5'; }
  if (document.doctype && !window.print) { br += 'm'; }
  ie = true;
}
else if (browser_dom && !browser_all) { br = 'op4'; opr = true; }
else if (document.images && !browser_all) { br = 'nn3'; nn = true; }
else if (document.clientWidth && !window.RegExp) { br = 'kq2'; kq = true; }
else { br = 'br'; }
if (ie || opr) { br_ieopr = true; } else { br_ieopr = false; }
if (ie || nn6) { br_ienn6 = true; } else { br_ienn6 = false; }
if (ie || opr || nn6) { br_ieoprnn6 = true; } else { br_ieoprnn6 = false; }

function select_menue_js(smjs_name,smjs_rewritefirst,smjs_rewritelast,smjs_wert,smjs_link) {
  if (smjs_rewritelast) {
    var smjs_wert_array = smjs_wert.split(',');
    if (smjs_wert_array[1] == 'n') {
      window.open(smjs_link + smjs_rewritefirst + smjs_wert_array[0] + smjs_rewritelast);
    }
    if (smjs_wert_array[1] == 'l') {
      window.location.href = smjs_link + smjs_rewritefirst + smjs_wert_array[0] + smjs_rewritelast;
    }
    else {
      window.location.href = smjs_link + smjs_rewritefirst + smjs_wert + smjs_rewritelast;
    }
  }
  else {
    window.location.href = smjs_link + '?' + smjs_name + '=' + smjs_wert;
  }
}

function question_action(question,action) {
  if (confirm(question)) {
    if (confirm('letztmalige Frage:\n\n' + question)) {
      eval(action);
    }
  }
}

function viewimage(urlandstring) {
  imageviewer = window.open(urlandstring,'Imageviewer','resizable=yes,status=yes,toolbar=no,menubar=no,location=no');
}
function viewimage_ws(urlandstring,wis_width,wis_height) {
  imageviewer = window.open(urlandstring,'Imageviewer','width=' + wis_width + ',height=' + wis_height + ',resizable=yes,location=no,status=no,toolbar=no,menubar=no');
}

var vi_stop = 0;
function valueinsert(vi_formular,vi_feld,vi_wert) {
  if (!vi_stop) {
    if (document[vi_formular][vi_feld]) {
      document[vi_formular][vi_feld].value = vi_wert;
    }
  }
}
function valueinsert_stop() {
  vi_stop = 1;
}

function set_focus(set_focus_form,set_focus_feld) {
  if (document[set_focus_form][set_focus_feld].value == '') {
    document[set_focus_form][set_focus_feld].focus();
  }
}

function wm_menue(wmm_wert) {
  if (wmm_wert == 1) {
    document.cookie = 'wm_menue=' + wmm_wert + '; path=/';
    var wmm_CookieWert = document.cookie;
    var wmm_SuchWert = /(wm_menue=1)/g;
    var wmm_SuchErgebnis = wmm_SuchWert.test(wmm_CookieWert);
    if (wmm_SuchErgebnis) { location.reload(); }
     else { alert('Cookies deaktiviert!\nUm diese Funktion zu nutzen, müssen Sie Cookies aktivieren bzw. zulassen.\nÄndern Sie die entsprechenden Einstellungen und versuchen Sie es erneut.'); }
  }
  else {
    document.cookie = 'wm_menue=' + wmm_wert + '; expires=Thu, 01-Jan-00 00:00:01 GMT; path=/';
    location.reload();
  }
}

wotag_array_01 = new Array('So','Mo','Di','Mi','Do','Fr','Sa');
wotag_array_02 = new Array('So., ','Mo., ','Di., ','Mi., ','Do., ','Fr., ','Sa., ');
wotag_array_03 = new Array('Sonntag, ','Montag, ','Dienstag, ','Mittwoch, ','Donnerstag, ','Freitag, ','Samstag, ');
wotag_array_04 = new Array('','','','','','','');
mon_array_01 = new Array('1.','2.','3.','4.','5.','6.','7.','8.','9.','10.','11.','12.');
mon_array_02 = new Array('01.','02.','03.','04.','05.','06.','07.','08.','09.','10.','11.','12.');
mon_array_03 = new Array(' Jan. ',' Feb. ',' März ',' Apr. ',' Mai ',' Jun. ',' Jul. ',' Aug. ',' Sep. ',' Okt. ',' Nov. ',' Dez. ');
mon_array_04 = new Array(' Januar ',' Februar ',' März ',' April ',' Mai ',' Juni ',' Juli ',' August ',' September ',' Oktober ',' November ',' Dezember ');
mon_array_05 = new Array('','','','','','','','','','','','');

function check_datum(check_datum_feldname_tag,check_datum_feldname_mon,check_datum_feldname_jahr,check_datum_feldname_wotag) {
  var check_datum_tag = document.formular[check_datum_feldname_tag].value;
  var check_datum_mon = document.formular[check_datum_feldname_mon].value;
  var check_datum_jahr = document.formular[check_datum_feldname_jahr].value;
  var monmaxtage = 31;
  if (check_datum_mon == 4 || check_datum_mon == 6 || check_datum_mon == 9 || check_datum_mon == 11) {
    var monmaxtage = 30;
  }
  if (check_datum_mon == 2) {
    var monmaxtage = 28;
    if (check_datum_jahr %   4 == 0) { monmaxtage = 29; }
    if (check_datum_jahr % 100 == 0) { monmaxtage = 28; }
    if (check_datum_jahr % 400 == 0) { monmaxtage = 29; }
  }
  if (check_datum_tag > monmaxtage) {
    alert ('In der Kombination Ihrer Auswahl von Jahr, Monat und Tag gibt es keinen ' +check_datum_tag+ '.!\n\nDer Tag wurde auf den höchsten im Monat vorkommen Tag ('+monmaxtage+'.) gesetzt.\nKorrigieren Sie bitte ggf. Ihre Auswahl.');
    document.formular[check_datum_feldname_tag].value = monmaxtage;
    document.formular[check_datum_feldname_tag].focus();
    var check_datum_time = new Date(check_datum_jahr,check_datum_mon - 1,monmaxtage);
  }
  else {
    var check_datum_time = new Date(check_datum_jahr,check_datum_mon - 1,check_datum_tag);
  }
  var check_datum_get_time = check_datum_time.getTime();
  var check_datum_get_time_wotag = check_datum_time.getDay();
  document.getElementById(check_datum_feldname_wotag).innerHTML = wotag_array_01[check_datum_get_time_wotag];
}

function js_nullmake(js_nullmake_zahl,js_nullmake_stellen) {
  js_nullmake_zahl = js_nullmake_zahl.toString();
  while(js_nullmake_zahl.length < js_nullmake_stellen) {
    js_nullmake_zahl = '0' + js_nullmake_zahl;
  }
  return js_nullmake_zahl;
}

function write_selectoption(w_so_start,w_so_stop,w_so_select,w_so_einheit,w_so_nullmake_value,w_so_nullmake_anzeige) {
  var w_so_stop_array = w_so_stop.split('|');
  var w_so_write = '';
  var w_so_einheit_array = w_so_einheit.split(',');
  for(var w_so_i=w_so_start;w_so_i<=w_so_stop_array[0];w_so_i++) {
    if (w_so_stop_array[1]) { var w_so_stop_regexp = new RegExp('(^|,)' + w_so_i + '(,|$)'); }
    if (!w_so_stop_array[1] || (w_so_stop_array[1] && w_so_stop_regexp.test(w_so_stop_array[1]) == true)) {
      var w_so_write_selected = ''; var w_so_einheit_view = '';
      if (w_so_einheit_array[1] && w_so_i == 1) { w_so_einheit_view = w_so_einheit_array[1]; } else if (w_so_einheit_array[2] && w_so_i == 0) { w_so_einheit_view = w_so_einheit_array[2]; } else { w_so_einheit_view = w_so_einheit_array[0]; }
      if (w_so_select == w_so_i) { w_so_write_selected = ' selected'; }
      if (w_so_nullmake_value) { w_so_i_value = js_nullmake(w_so_i,w_so_nullmake_value); } else { w_so_i_value = w_so_i; }
      if (w_so_nullmake_anzeige == 'monat') { w_so_i_anzeige = mon_array_03[(w_so_i - 1)]; } else if (w_so_einheit_array[2] && w_so_i == 0) { w_so_i_anzeige = ''; } else if (w_so_nullmake_anzeige) { w_so_i_anzeige = js_nullmake(w_so_i,w_so_nullmake_anzeige); } else { w_so_i_anzeige = w_so_i; }
      w_so_write = w_so_write + '<option value=\'' + w_so_i_value + '\'' + w_so_write_selected + '>' + w_so_i_anzeige + w_so_einheit_view + '</option>';
    }
  }
  document.write(w_so_write);
}
function write_selectoption2(w_so2,w_so2_select) {
  var w_so2_array = w_so2.split(',');
  var w_so2_write = '';
  while (w_so2_array.length > 0) {
    w_so2_array_shift = w_so2_array.shift();
    var w_so2_array_shift_array = w_so2_array_shift.split('|');
    var w_so2_write_selected = '';
    if (w_so2_select == w_so2_array_shift_array[0]) { w_so2_write_selected = ' selected'; }
    w_so2_write = w_so2_write + '<option value=\'' + w_so2_array_shift_array[0] + '\'' + w_so2_write_selected + '>' + w_so2_array_shift_array[1] + '</option>';
  }
  document.write(w_so2_write);
}

ec_class = '';
function emailcrypt(ec_domain,ec_alias,ec_link,ec_text,ec_description,ec_target) {
  ec_domain_view = ec_domain;
  if (ec_link) {
    if (ec_link == 'mailto') {
      if (ec_target.search(/^\?/) != -1) {
        ec_domain += ec_target;
        ec_target = '';
      }
      document.write('<a href="mailto:' + ec_alias + '@' + ec_domain + '"');
    }
    else { document.write('<a href="' + ec_link + '"'); }
  }
  if (ec_link && ec_target) { document.write(' target="' + ec_target + '"'); }
  if (ec_link && ec_class) { document.write(' class=' + ec_class); ec_class = ''; }
  if (ec_link && ec_description) { document.write(' title="' + ec_description + '"'); }
  if (ec_link) { document.write('>'); }
  if (ec_text) { document.write(ec_text); }
  else { document.write(ec_alias + '@' + ec_domain_view); }
  if (ec_link) { document.write('</a>'); }
}

var base64s = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
function base64_encode(b64e_str) {
  var b64e_bits;
  var b64e_dual;
  var b64e_i = 0;
  var b64e_return = '';
  while(b64e_str.length >= b64e_i + 3) {
    b64e_bits = (b64e_str.charCodeAt(b64e_i++) & 0xff) <<16 | (b64e_str.charCodeAt(b64e_i++) & 0xff) <<8 | b64e_str.charCodeAt(b64e_i++) & 0xff;
    b64e_return += base64s.charAt((b64e_bits & 0x00fc0000) >>18) + base64s.charAt((b64e_bits & 0x0003f000) >>12) + base64s.charAt((b64e_bits & 0x00000fc0) >> 6) + base64s.charAt((b64e_bits & 0x0000003f));
  }
  if (b64e_str.length -b64e_i > 0 && b64e_str.length -b64e_i < 3) {
    b64e_dual = Boolean(b64e_str.length -b64e_i -1);
    b64e_bits = ((b64e_str.charCodeAt(b64e_i++) & 0xff) <<16) | (b64e_dual ? (b64e_str.charCodeAt(b64e_i) & 0xff) <<8 : 0);
    b64e_return += base64s.charAt((b64e_bits & 0x00fc0000) >>18) + base64s.charAt((b64e_bits & 0x0003f000) >>12) + (b64e_dual ? base64s.charAt((b64e_bits & 0x00000fc0) >>6) : '=') + '=';
  }
  return(b64e_return);
}

function onload_image(oli_image,oli_add_height,oli_action) {
  if (window.innerWidth) { oli_window_width = window.innerWidth; }
  else if (document.body && document.body.offsetWidth) { oli_window_width = document.body.offsetWidth; }
  else { oli_window_width = 0; }
  if (window.innerHeight) { oli_window_height = window.innerHeight; }
  else if (document.body && document.body.offsetHeight) { oli_window_height = document.body.offsetHeight; }
  else { oli_window_height = 0; }
  if (ie) { oli_window_width -= 4; oli_window_height -= 4; }
  if (oli_window_width > 0 && oli_window_height > 0 && (oli_window_width != oli_image.width || oli_window_height != oli_image.height + oli_add_height)) {
    oli_window_width_new = oli_image.width + 12;
    oli_window_height_new = oli_image.height + 51 + oli_add_height;
    self.resizeTo(oli_window_width_new,oli_window_height_new);
    if (window.innerWidth) { oli_window_width = window.innerWidth; }
    else if (document.body && document.body.offsetWidth) { oli_window_width = document.body.offsetWidth; }
    else { oli_window_width = 0; }
    if (window.innerHeight) { oli_window_height = window.innerHeight; }
    else if (document.body && document.body.offsetHeight) { oli_window_height = document.body.offsetHeight; }
    else { oli_window_height = 0; }
    if (oli_window_width > 0 && oli_window_height > 0 && (oli_window_width - 4 != oli_image.width || oli_window_height - 4 != oli_image.height)) {
      oli_window_width_new = oli_window_width_new - oli_window_width + oli_image.width;
      oli_window_height_new = oli_window_height_new - oli_window_height + oli_image.height;
      if (ie) { oli_window_width_new += 4; oli_window_height_new += 4; }
      self.resizeTo(oli_window_width_new,oli_window_height_new + oli_add_height);
    }
  }
  if (oli_action) { eval(oli_action); }
  self.focus();
}

nt_pos_array = new Array();
nt_pos_now = nt_pos_next = 0;
nt_auto = nt_method = nt_style_nup = '';
var nt_pospx = nt_poss = nt_poss_slide = 0,nt_time;
function nt(nt_val) {
  nt_content.unshift('&nbsp;');
  nt_content.push(nt_content[1]);
  if (nt_scroll == 'up') {
    nt_div_style = 'style="width:' + nt_width + 'px;height:' + (nt_height + nt_padding_move) + 'px;padding:' + nt_padding_move + 'px ' + nt_padding + 'px ' + nt_padding_move + 'px ' + nt_padding + 'px;overflow:hidden;' + nt_style_pad + '"'; } else {
    nt_div_style = 'style="width:' + (nt_width + nt_padding_move) + 'px;height:' + nt_height + 'px;padding:' + nt_padding + 'px ' + nt_padding_move + 'px ' + nt_padding + 'px ' + nt_padding_move + 'px;overflow:hidden;' + nt_style_pad + '"';
  }
  document.write('<div id="div_nt" ' + nt_div_style + '><div id="div_nt_sub" style="width:' + nt_width + 'px;height:' + nt_height + 'px;' + nt_style + 'overflow:hidden;">');
  if (nt_scroll != 'up') { nt_style_nup = 'text-align:left;white-space:nowrap;'; }
  document.write('<div id="nt_slider_div" style="position:relative;top:0px;left:0px;' + nt_style_nup + '">');
  for(nt_i=0;nt_i<nt_content.length;nt_i++) {
    if (nt_scroll== 'up') { document.write('<div id=ntid' + nt_i + ' style="width:' + nt_width + 'px;height:' + nt_height + 'px;text-align:left;" class="css_nt_font">'); }
    else { document.write('<span id=ntid' + nt_i + ' class="css_nt">'); }
    if (nt_scroll == 'up') { document.write(nt_content[nt_i] + '</div>'); }
    else { document.write(nt_content[nt_i] + '</span>'); }
  }
  document.write('</div></div></div>');
  if (br_ieopr) {
    with(document.getElementById('div_nt')) {
      onmouseover = new Function('nt_Pause("stop")');
      onmouseout = new Function('nt_Pause("start")');
    }
  }
  for(nt_i = 0;nt_i < nt_content.length;nt_i++) {
    if (nt_scroll == 'up') { if (nt_i == 0) { nt_pos = 0; } else { nt_pos += document.getElementById('ntid' + (nt_i-1)).offsetHeight; } }
    else {
      if (nt_i == 0) { nt_pos = 0; }
      else {
        if (document.getElementById('ntid' + (nt_i-1)).offsetWidth < nt_width) {
          posDiff = nt_width - document.getElementById('ntid' + (nt_i-1)).offsetWidth;
          nt_pos += document.getElementById('ntid' + (nt_i-1)).offsetWidth + posDiff;
          document.getElementById('ntid' + nt_i).style.marginLeft = posDiff + 'px';
        }
        else {
          nt_pos += document.getElementById('ntid' + (nt_i-1)).offsetWidth;
        }
      }
    }
    nt_pos_array[nt_i] = nt_pos;
  }
  if (nt_val == 'auto') { nt_Slider(nt_val); }
}
function nt_Slider(nts_val) {
  if (nts_val == 'auto' || nts_val == 'pre' || nts_val == 'next') { nt_method = nts_val; }
  else { nt_method = ''; }
  if (nt_auto) { clearTimeout(nt_auto); }
  if (nt_method == 'auto') {
    nt_pos_next = nt_pos_now + 1;
    if (nt_pos_next >= nt_content.length) { nt_pos_next = 1; }
  }
  else {
    if (nt_method == 'next') { nt_pos_next = nt_pos_now + 1; }
    else if (nt_method == 'pre') { nt_pos_next = nt_pos_now - 1; }
    else { nt_pos_next = nts_val; }
    if (nt_pos_next >= nt_content.length - 1) { nt_pos_next = nt_content.length - 2; }
    if (nt_pos_next < 1) { nt_pos_next = 1; }
  }
  nt_pospx  = nt_pos_array[nt_pos_next] - (nt_pos_array[nt_pos_next] * 2);
  if (br_ieoprnn6) { clearTimeout(nt_time); }
  nt_Slide();
}
function nt_Pause(ntp_val) {
  if (ntp_val == 'stop') {
    if (nt_time) { clearTimeout(nt_time); }
    if (nt_auto) { clearTimeout(nt_auto); }
  }
  else { nt_Slide(); }
}
function nt_Slide() {
  nt_speed_sl = nt_speed;
  if (!ie) { nt_speed_sl = nt_speed + 600; }
  nt_time = setTimeout('nt_Slide()',0);
  if (nt_method == 'auto' && nt_auto && nt_pos_next == 1) { nt_poss = -nt_pos_array[1]; }
  else {
    nt_poss -= 1000 / nt_speed_sl;
    nt_poss_slide = Math.round(nt_poss);
    if (nt_poss - 1000 / nt_speed_sl < nt_pospx) { nt_poss = nt_pospx; }
  }
  if (browser_dom) {
    if (nt_scroll == 'up') { document.getElementById('nt_slider_div').style.top  = nt_poss + 'px'; }
    else { document.getElementById('nt_slider_div').style.left = nt_poss + 'px'; }
  }
  else if (browser_all) {
    if (nt_scroll == 'up') { document.all['nt_slider_div'].style.top  = nt_poss + 'px'; }
    else { document.all['nt_slider_div'].style.left = nt_poss + 'px'; }
  }
  if (nt_method == 'auto' && nt_pos_next == 1 && nt_pos_now == nt_content.length - 1) {
    clearTimeout(nt_time);
    nt_pos_now = 1;
    nt_pospx = nt_poss = nt_poss_slide = -nt_pos_array[1],nt_time;
    nt_auto = setTimeout('nt_Slider("auto")',0);    
  }
  else if (nt_method == 'auto' && nt_pospx == nt_poss) {
    clearTimeout(nt_time);
    nt_pos_now = nt_pos_next;
    nt_auto = setTimeout('nt_Slider("auto")',nt_pausetime);
  }    
  else {
    if (nt_pospx == nt_poss) { clearTimeout(nt_time); nt_pos_now = nt_pos_next; }
  }
}


/* © by WebMentor (www.webmentor.de) */