(function() {
  var but_unten, geturl, lang_init, mail_chk, menu_init, proj_hover, seturl, uberu_hover, windimg;
  window._AC = false;
  window._pre = new Array();
  $(document).ready(function() {
    menu_init();
    geturl();
    _fnc_page('aktuell', true);
    _fnc_page(window._page);
    but_unten();
    lang_init();
    $('div.wind').children('div.big_img').position({
      my: "center",
      at: "center"
    });
    $('div.wind>div.cl>#cl').click(function() {
      return $('div.wind').hide();
    });
    return $('div.wind>div.ba').click(function() {
      return $('div.wind').hide();
    });
  });
  menu_init = function() {
    $('td.menu>ul.menuul>li.mmenu>div>div').click(function() {
      var idd;
      idd = $(this).parent('div').attr('id');
      return _fnc_page(idd);
    });
    $('td.menu>ul.menuul>li.mmenu>div     >ul>li>div').click(function() {
      var idd, idu;
      idd = $(this).closest('div').attr('id');
      idu = $(this).closest('ul').parent('div').attr('id');
      return _fnc_page(idu + '_' + idd);
    });
    $('td.menu>ul.menuul>li.mmenu>div.proj>ul>li>div').mouseover(function() {
      var idd;
      idd = $(this).attr('id');
      return proj_hover(idd);
    });
    return $('td.menu>ul.menuul>li.mmenu>div.ueberuns>ul>li>div').hoverIntent({
      over: function() {
        return uberu_hover($(this).attr('id'));
      },
      out: function() {
        return uberu_hover(window._ueberuns);
      },
      timeout: 0
    });
  };
  var _fnc_page = function(idd, hide, force) {
    var ub, ud;
    if (hide == null) {
      hide = false;
    }
    if (force == null) {
      force = false;
    }
    ub = idd.split('_');
    window._local = hide;
    $('div.emediaplayer').remove();
    if (hide === false) {
      window._page = idd;
      $('td.menu>ul.menuul>li.mmenu>div:not(#' + ub[0] + ')>ul').slideUp(800);
      $('td.menu>ul.menuul>li.mmenu>div#' + ub[0] + '>ul').slideDown(800);
    }
    window._akt = false;
    if (ub[0] === 'aktuell') {
      window._akt = true;
      window._cpage = "proj";
    } else {
      window._cpage = ub[0];
    }
    if (ub[0] === 'ueberuns') {
      if (!ub[1]) {
        ub[1] = "_main";
        window._ueberuns = null;
      } else {
        window._ueberuns = ub[1];
      }
    }
    if (force === true) {
      $('div.divcont.p_' + idd).remove();
      if ((window._cpage === "proj" && window._page !== "proj") || ub[0] === 'ueberuns') {
        $('div.divcont.p_' + ub[0]).remove();
      }
    }
    if (ub[0] === 'ueberuns' && $('div.divcont.p_' + ub[0]).length && force === false) {
      ud = $('div.divcont.p_' + ub[0] + '>table>tbody>tr>td.cont_ueberuns');
      if (!ud.children('div#' + ub[1]).length) {
        $.ajax({
          type: "POST",
          url: "content.php",
          async: false,
          data: {
            typ: ub[0],
            sub: ub[1],
            old: true,
            adm: window._AC
          },
          success: function(data) {
            var d;
            ud = $('div.divcont.p_ueberuns>table>tbody>tr>td.cont_ueberuns');
            ud.children('div').hide();
            d = $(data).langchange();
            if (window._local === false) {
              d.hide().appendTo(ud).show();
            } else {
              d.hide().appendTo(ud);
            }
            if (window._AC === true) {
              return d.adm_after();
            }
          }
        });
      } else {
        $("div.divcont").fadeOut(500);
        ud.children('div').hide();
        $("div.divcont.p_ueberuns").fadeIn(500);
        ud.children('div#' + ub[1]).show();
      }
    } else {
      if (!$('div.divcont.p_' + idd).length || force === true) {
        $.ajax({
          type: "POST",
          url: "content.php",
          async: false,
          data: {
            typ: ub[0],
            sub: ub[1],
            adm: window._AC
          },
          success: function(data) {
            var d;
            $("div.divcont").hide();
            d = $(data).langchange();
            if (window._local === false) {
              d.appendTo($("td.main")).newpage_func(window._cpage).show();
            } else {
              d.hide().appendTo($("td.main")).newpage_func(window._cpage);
            }
            if (window._AC === true) {
              return d.adm_after();
            }
          }
        });
      } else {
        $('div.divcont').fadeOut(500);
        $('div.divcont.p_' + idd).fadeIn(500);
        if (window._cpage === 'proj' && window._page !== 'proj' && window._akt === false) {
          $('div.divcont.p_' + idd).find('table.kalender').remove();
          $('div.divcont.p_' + idd).find('div.kalhead').show();
        }
      }
    }
    if (hide === false) {
      seturl();
    }
	try {
		return delete window._local;
	}
	catch(e){}
  };
  geturl = function() {
    var ur;
    ur = document.location.hash;
    ur = ur.substr(1);
    if (ur === '') {
      window._page = "start";
      return window._lang = "de";
    } else {
      ur = ur.split('-');
      if (!ur[0]) {
        window._lang = "de";
      } else {
        window._lang = ur[0];
      }
      if (!ur[1]) {
        return window._page = "start";
      } else {
        return window._page = ur[1];
      }
    }
  };
  seturl = function() {
    return window.location.href = "#" + window._lang + "-" + window._page;
  };
  but_unten = function() {
    $('div.but_unten').hover((function() {
      return $(this).children('img').animate({
        width: '20px',
        height: '20px',
        top: '10px',
        left: '10px'
      }, 400);
    }), function() {
      return $(this).children('img').animate({
        width: '40px',
        height: '40px',
        top: '0px',
        left: '0px'
      }, 400);
    });
    return $('div.but_unten').click(function() {
      var id;
      id = $(this).attr('id');
      return _fnc_page(id);
    });
  };
  lang_init = function() {
    return $('div.lang_change').click(function() {
      var id;
      id = $(this).attr('id');
      return $('html').langchange(id);
    });
  };
  proj_hover = function(id) {
    return $('div.divcont.p_proj').find('td:first-child').find('img').attr('src', 'content/proj/' + id + '/im/flyer_v.png');
  };
  uberu_hover = function(id) {
    if (id === null) {
      return $('div.divcont.p_ueberuns').find('td:last-child').find('div.bigueber').html('');
    } else {
      return $('div.divcont.p_ueberuns').find('td:last-child').find('div.bigueber').html(window._pre.ueberuns[id]);
    }
  };
  mail_chk = function(em) {
    if (em === '') {
      return false;
    } else {
      em = em.split('@');
      if (em.length < 2) {
        return false;
      } else {
        em = em[1].split('.');
        if (em.length < 2) {
          return false;
        }
      }
    }
    return true;
  };
  windimg = function(src, sing) {
    var el;
    if (sing == null) {
      sing = false;
    }
    $('div.wind>div.big_img>img').remove();
    $('div.wind>div.big_img>div.loading').show();
    $('div.wind>div.cl>#prev').hide().unbind('click');
    $('div.wind>div.cl>#next').hide().unbind('click');
    if (sing === false) {
      if (window._cpage === 'proj' && window._page !== 'proj') {
        el = $('div.divcont.p_' + window._page).find('div.projekte_imdiv').children('img');
        if (el.last().attr('file') !== src) {
          $('div.wind>div.cl>#next').show().click(function() {
            src = $('div.wind>div.big_img>img').attr('src');
            el = $('div.divcont.p_' + window._page + ' div.projekte_imdiv>img[file="' + src + '"]').next().attr('file');
            return windimg(el);
          });
        }
        if (el.first().attr('file') !== src) {
          $('div.wind>div.cl>#prev').show().click(function() {
            src = $('div.wind>div.big_img>img').attr('src');
            el = $('div.divcont.p_' + window._page + ' div.projekte_imdiv>img[file="' + src + '"]').prev('img').attr('file');
            return windimg(el);
          });
        }
      }
    }
    $('div.wind').fadeIn(500);
    window.scrollTo(0, 0);
    return $('<img src="' + src + '">').load(function() {
      $('div.wind').find('div.big_img').find('div.loading').hide();
      if (window._cpage === 'proj' && window._page !== 'proj' && sing === false) {
        el = $('div.divcont.p_' + window._page).find('div.projekte_imdiv').children('img');
        if (el.last().attr('file') !== src) {
          $(this).click(function() {
            src = $('div.wind>div.big_img>img').attr('src');
            el = $('div.divcont.p_' + window._page + ' div.projekte_imdiv>img[file="' + src + '"]').next().attr('file');
            return windimg(el);
          });
        } else {
          $(this).click(function() {
            el = $('div.divcont.p_' + window._page + ' div.projekte_imdiv>img:first-child').attr('file');
            return windimg(el);
          });
        }
      } else if (sing === true) {
        $(this).click(function() {
          return $('div.wind').hide();
        });
      }
      return $(this).hide().appendTo($('div.wind>div.big_img')).fadeIn(500);
    });
  };
  (function($) {
    var kalender, make_kal;
    $.fn.langchange = function(nl) {
      if (nl == null) {
        nl = window._lang;
      }
      return this.each(function() {
        window._lang = nl;
        $(this).find('[lang=' + window._lang + ']').show();
        $(this).find('[lang]:not([lang=' + window._lang + '])').hide();
        return seturl();
      });
    };
    $.fn.emedia = function(sub) {
      if (sub == null) {
        sub = false;
      }
      return this.each(function() {
        return $(this).find('div.emedia').each(function() {
          return $(this).click(function() {
            var ad, link, pos_td, pos_th, td, tit, titi, track, typ;
            typ = $(this).attr('typ');
            track = $(this).attr('track');
            link = $(this).attr('link');
            tit = $(this).find('div.songtit').text();
            ad = {
              'soundcloud': '<div class="emediaplayer" typ="' + typ + '" id="' + track + '"><object height="81" width="100%"> <param name="movie" value="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F' + track + '&amp;show_comments=false&amp;auto_play=true&amp;color=000000"></param> <param name="allowscriptaccess" value="always"></param> <embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F' + track + '&amp;show_comments=false&amp;auto_play=true&amp;color=000000" type="application/x-shockwave-flash" width="100%"></embed> </object></div>',
              'vimeo': '<div class="emediaplayer" typ="' + typ + '" id="' + track + '"><iframe src="http://player.vimeo.com/video/' + track + '?title=0&amp;byline=0&amp;portrait=0&amp;color=ffffff&amp;autoplay=1" width="334" height="334" frameborder="0"></iframe></div>'
            };
            titi = '<div><a href="' + link + '" target=_blank>' + tit + '</a></div>';
            $(this).addClass('active').siblings('div.emedia').removeClass('active');
            td = $(this).closest('td').next('td').children('div.player');
            if (window._cpage === 'musik') {
              td.html('<img src="' + $(this).attr('img') + '">');
              if (!$(this).find('div[typ="' + typ + '"]#' + track + '').length) {
                ad[typ] = $(ad[typ]);
                return $(this).children('div:last-child').append(ad[typ]);
              }
            } else {
              ad[typ] = $(ad[typ]).append(titi);
              td.html(ad[typ]);
              if (window._cpage === 'proj') {
                pos_td = td.offset();
                pos_th = $(this).prevAll('hr').first().offset();
                if (pos_td.top < pos_th.top) {
                  return $('<div class="space" id="' + typ + '">&nbsp;</div>').prependTo(td).css({
                    height: (pos_th.top - pos_td.top) + 'px'
                  });
                }
              }
            }
          });
        });
      });
    };
    $.fn.newpage_func = function(fn) {
      var fk;
      fk = {
        'musik': function(th) {
          return th.each(function() {
            return $(this).emedia();
          });
        },
        'videos': function(th) {
          return th.each(function() {
            return $(this).emedia();
          });
        },
        'start': function(th) {
          return th.each(function() {
            return $('div.divcont.p_start').find('td:last-child').children('div').click(function() {
              return _fnc_page('aktuell');
            });
          });
        },
        'presse': function(th) {
          return th.each(function() {
            return $(this).find('td.primg').children('img').click(function() {
              return windimg($(this).attr('file'), true);
            });
          });
        },
        'proj': function(th) {
          return th.each(function() {
            var heute, today;
            if (window._page === 'proj') {
              $(this).find('td:last-child').children('img.c').mouseover(function() {
                return proj_hover($(this).attr('id'));
              });
              return $(this).find('td:last-child').children('img.c').click(function() {
                return _fnc_page('proj_' + $(this).attr('id'));
              });
            } else {
              $(this).emedia();
              $(this).find('div.menu-lnk#newsletter').click(function() {
                return _fnc_page('newsletter');
              });
              window._local = true;
              heute = new Date();
              today = heute.getYear() + '-' + heute.getMonth() + '-' + heute.getDay();
              $(this).find('.datdown').each(function() {
                if (window._local && today > $(this).attr('id')) {
                  $(this).show();
                  $(this).addClass('vis');
                  try{
						return delete window._local;
				  } catch(e){}
                }
              });
              try{
				 delete window._local;
			  } catch(e){}
              $(this).find('div.dathd').children('.dath').click(function() {
                if ($(this).siblings('.datdown').hasClass('vis')) {
                  $(this).siblings('.datdown').hide();
                  return $(this).siblings('.datdown').removeClass('vis');
                } else {
                  $(this).siblings('.datdown').show();
                  return $(this).siblings('.datdown').addClass('vis');
                }
              });
              $(this).find('div.pressh').click(function() {
                if ($(this).siblings('table.presshc').hasClass('vis')) {
                  $(this).siblings('table.presshc').hide();
                  return $(this).siblings('table.presshc').removeClass('vis');
                } else {
                  $(this).siblings('table.presshc').show();
                  return $(this).siblings('table.presshc').addClass('vis');
                }
              });
              $(this).find('td.primg').children('img').click(function() {
                return windimg($(this).attr('file'), true);
              });
              if (window._akt === true) {
                kalender();
                $(this).find('div.kalhead').hide().click(function() {
                  $(this).next('table.kalender').slideDown(500);
                  return $(this).slideUp(500);
                });
              } else {
                $(this).find('div.kalhead').show().click(function() {
                  $('table.kalender').first().clone(true).hide().insertAfter($(this)).slideDown(500).find('th.kalhead').unbind('click').click(function() {
                    $(this).closest('table.kalender').prev('div.kalhead').slideDown(500);
                    return $(this).closest('table.kalender').slideUp(500).remove();
                  });
                  return $(this).slideUp(500);
                });
              }
              return $(this).find('div.projekte_imdiv').children('img').click(function() {
                return windimg($(this).attr('file'));
              });
            }
          });
        },
        'ueberuns': function(th) {
          return th.each(function() {
            window._pre.ueberuns = new Array;
            return $(this).find('td.ueberuns').children('img.c').each(function() {
              var id;
              id = $(this).attr('id');
              window._pre.ueberuns[id] = $('<img src="content/ueberuns/' + id + '/im/_v.jpg">');
              return $(this).click(function() {
                _fnc_page('ueberuns_' + $(this).attr('id'));
                return uberu_hover($(this).attr('id'));
              });
            });
          });
        },
        'kontakt': function(th) {
          return th.each(function() {
            $('div.button#k_send').siblings('input, textarea').focus(function() {
              return $(this).siblings('.warni').hide();
            });
            $('div.button#k_reset').click(function() {
              $(this).siblings('input:not([type=checkbox])').val('');
              return $(this).siblings('textarea').val('');
            });
            return $('div.button#k_send').click(function() {
              var chk, em;
              chk = true;
              if ($(this).siblings('input#fname').val() === '') {
                $(this).siblings('.warni#fname').show();
                chk = false;
              }
              em = $(this).siblings('input#femail').val();
              if (mail_chk(em) === false) {
                $(this).siblings('.warni#femail').show();
                chk = false;
              }
              if ($(this).siblings('textarea#fnachr').val() === '') {
                $(this).siblings('.warni#fnachr').show();
                chk = false;
              }
              if (chk === true) {
                return $.ajax({
                  type: "POST",
                  url: "kontakt_send.php",
                  async: true,
                  dataType: 'json',
                  data: {
                    email: $(this).siblings('input#femail').val(),
                    name: $(this).siblings('input#fname').val(),
                    res: $(this).siblings('input#fres:checked').val(),
                    nachr: $(this).siblings('textarea#fnachr').val(),
                    lang: window._lang
                  },
                  success: function(data) {
                    if (data === 'true') {
                      return $('div.button#k_send').siblings('.warni.ok#sent').show();
                    }
                  }
                });
              }
            });
          });
        },
        'newsletter': function(th) {
          return th.each(function() {
            $('div.nlform').find('input, textarea').focus(function() {
              return $('.warni').hide();
            });
            $('div.nlform').find('div.button#nl_reset').click(function() {
              $(this).siblings('input:not([type=checkbox])').val('');
              return $(this).siblings('textarea').val('');
            });
            $('div.nlform').find('div.button.nl').click(function() {
              $('.warni').hide();
              if ($(this).attr('id') === 'nl_out') {
                $(this).siblings('#nl_in').show();
                $(this).hide();
                $(this).siblings('.nl_in').show();
                $(this).siblings('.nl_out').hide();
              }
              if ($(this).attr('id') === 'nl_in') {
                $(this).hide();
                $(this).siblings('#nl_out').show();
                $(this).siblings('.nl_in').hide();
                return $(this).siblings('.nl_out').show();
              }
            });
            return $('div.nlform').find('div.button#nl_send').click(function() {
              var chk, code, em, typ;
              $('.warni').hide();
              chk = true;
              if ($(this).siblings('span.nl_out').is(':visible')) {
                code = $(this).siblings('span.nl_out').find('input#fcode').val();
                if (code.length !== 8 && code !== '') {
                  $(this).siblings('span.nl_out').find('.warni#fcode').show();
                  chk = false;
                }
                em = $(this).siblings('span.nl_out').find('input#femail').val();
                if (mail_chk(em) === false) {
                  $(this).siblings('span.nl_out').find('.warni#femail').show();
                  chk = false;
                }
                typ = 'nl_out';
              } else {
                if ($(this).siblings('span.nl_in').find('input#fname').val() === '') {
                  $(this).siblings('span.nl_in').find('.warni#fname').show();
                  chk = false;
                }
                em = $(this).siblings('span.nl_in').find('input#femail').val();
                if (mail_chk(em) === false) {
                  $(this).siblings('span.nl_in').find('.warni#femail').show();
                  chk = false;
                }
                typ = 'nl_in';
              }
              if (chk === true) {
                return $.ajax({
                  type: "POST",
                  url: "newsletter_send.php",
                  async: true,
                  data: {
                    email: $(this).siblings('span.' + typ).find('input#femail').val(),
                    name: $(this).siblings('span.' + typ).find('input#fname').val(),
                    nachr: $(this).siblings('span.' + typ).find('input#fnachr').val(),
                    code: $(this).siblings('span.' + typ).find('input#fcode').val(),
                    lang: window._lang,
                    typ: typ
                  },
                  success: function(data) {
                    data = data.split('|-|-|');
                    if (data[0] === 'true') {
                      return $('div.nlform').find('div.button#nl_send').siblings('.warni.ok').html(data[1]).show();
                    } else if (data[0] === 'false') {
                      return $('div.nlform').find('div.button#nl_send').siblings('.warni.mes').html(data[1]).show();
                    }
                  }
                });
              }
            });
          });
        }
      };
      if (fk[fn] !== void 0) {
        fk[fn](this);
      }
      return this;
    };
    kalender = function() {
      return $.ajax({
        type: "POST",
        url: "kalender.php",
        async: true,
        dataType: 'json',
        data: {
          kalender: 'd'
        },
        success: function(data) {
          window._kalvar = data;
          return make_kal(true);
        }
      });
    };
    make_kal = function(init) {
      var c, d, da, dtab, first, ful, heute, i, ii, m, nm, pm, r, tab, tab2, _i, _len, _ref, _ref2, _ref3, _ref4;
      if (init == null) {
        init = false;
      }
      d = window._kalvar;
      if (init === true) {
        heute = new Date();
        window._kal = {
          d: heute,
          Y: heute.getFullYear(),
          M: heute.getMonth()
        };
      } else {
        window._kal.d.setYear(window._kal.Y);
        window._kal.d.setMonth(window._kal.M);
      }
      tab = '\n<table class="kalender"><tbody>\n<tr><th colspan="7">\n      <table><tr><th align="left" style="width:40px;">\n    <div class="y_prev">&laquo;&nbsp;&nbsp;</div>\n    <div class="m_prev">&lt;</div>\n      </th><th align="center"  class="kalhead">' + d['month'][window._kal.M] + ' ' + window._kal.Y + '</th><th align="right" style="width:40px;">\n\n    <div class="y_next">&nbsp;&nbsp;&raquo;</div>\n    <div class="m_next">&gt;</div>\n      </th></tr></table>\n</th></tr><tr class="dh">';
      _ref = d['day'];
      for (_i = 0, _len = _ref.length; _i < _len; _i++) {
        da = _ref[_i];
        tab += '<th>' + da + '</th>';
      }
      tab += '</tr>';
      tab2 = '</tbody></table>';
      first = window._kal.d;
      first.setDate(1);
      first = first.getDay();
      pm = window._kal.M - 1;
      m = window._kal.M;
      nm = window._kal.M + 1;
      if (pm === -1) {
        pm = 11;
      } else if (pm === 12) {
        pm = 0;
      }
      r = 0;
      c = 0;
      dtab = '<tr class="d">';
      if (first === 0) {
        first = 7;
      }
      for (i = _ref2 = first - 1; _ref2 <= 0 ? i < 0 : i > 0; _ref2 <= 0 ? i++ : i--) {
        dtab += '<td class="m_prev">' + (d['dom'][pm] - i + 1) + '</td>';
        c++;
      }
      for (i = 1, _ref3 = d['dom'][m]; 1 <= _ref3 ? i <= _ref3 : i >= _ref3; 1 <= _ref3 ? i++ : i--) {
        dtab += '<td';
        if (i < 10) {
          ii = "0" + i;
        } else {
          ii = i;
        }
        m = window._kal.M + 1;
        if (m < 10) {
          m = "0" + m;
        }
        if (d['events'][window._kal.Y + '-' + m + '-' + ii]) {
          dtab += ' class="termin" id="' + window._kal.Y + '-' + m + '-' + ii + '"';
        }
        dtab += '>' + i + '</td>';
        c++;
        if ((c % 7) === 0 && c !== 42) {
          dtab += '</tr><tr class="d">';
          r++;
        }
      }
      for (i = 1, _ref4 = 42 - c; 1 <= _ref4 ? i <= _ref4 : i >= _ref4; 1 <= _ref4 ? i++ : i--) {
        dtab += '<td class="m_next">' + i + '</td>';
        c++;
        if ((c % 7) === 0 && c !== 42) {
          dtab += '</tr><tr class="d">';
          r++;
        }
      }
      dtab += '</tr>';
      if (init === true) {
        ful = $(tab + dtab + tab2);
      } else {
        ful = $(dtab);
      }
      if (init === true) {
        ful.find('th.kalhead').click(function() {
          $(this).closest('table.kalender').hide();
          return $(this).closest('table.kalender').prev('div.kalhead').show();
        });
        return ful.insertAfter($('div.divcont.p_aktuell').find('div.kalhead')).kal_init();
      } else {
        $('table.kalender').find('tr.d').remove();
        $('table.kalender').find('th.kalhead').html(d['month'][window._kal.M] + ' ' + window._kal.Y);
        return ful.insertAfter($('table.kalender').find('tr.dh')).kal_init();
      }
    };
    return $.fn.kal_init = function() {
      return this.each(function() {
        $(this).find('.y_prev').click(function() {
          window._kal.Y = window._kal.Y - 1;
          return make_kal();
        });
        $(this).find('.y_next').click(function() {
          window._kal.Y = window._kal.Y + 1;
          return make_kal();
        });
        $(this).find('.m_next').click(function() {
          window._kal.M = window._kal.M + 1;
          if (window._kal.M === 12) {
            window._kal.M = 0;
            window._kal.Y = window._kal.Y + 1;
          }
          return make_kal();
        });
        $(this).find('.m_prev').click(function() {
          window._kal.M = window._kal.M - 1;
          if (window._kal.M < 0) {
            window._kal.M = 12;
            window._kal.Y = window._kal.Y - 1;
          }
          return make_kal();
        });
        return $(this).find('td.termin').hoverIntent({
          over: function() {
            var dd, de, pid, pos, tod, tot, _i, _len;
            dd = window._kalvar['events'][$(this).attr('id')];
            tot = $('<div class="termin_over" id="' + $(this).attr('id') + '"></div>');
            for (_i = 0, _len = dd.length; _i < _len; _i++) {
              de = dd[_i];
              tod = '<div class="termin_ov" proj="' + de['submenu'] + '"><b>' + de['projectname'] + '</b>';
              if (de['de'] !== '') {
                tod += '<br>' + de['de'];
              }
              if (de['addinf2'] !== '') {
                tod += '<br>' + de['addinf2'];
              }
              tod += '</div>';
              pid = de['submenu'];
              $(tod).click(function() {
                return _fnc_page('proj_' + de['submenu']);
              }).appendTo(tot);
            }
            if (dd.length === 1) {
              $(this).click(function() {
                return _fnc_page('proj_' + pid);
              });
            }
            pos = $(this).offset();
            return tot.appendTo($('body')).css({
              top: pos.top + $(this).height() + 5 + 'px',
              left: pos.left + 'px'
            }).hoverIntent({
              over: function() {
                return $('td.termin#' + $(this).attr('id')).addClass('vis');
              },
              out: function() {
                $('td.termin#' + $(this).attr('id')).removeClass('vis');
                return $(this).remove();
              },
              timeout: 200
            });
          },
          out: function() {
            if (!$(this).hasClass('vis')) {
              return $('div.termin_over').remove();
            }
          },
          timeout: 500
        });
      });
    };
  })(jQuery);
}).call(this);

