//Google Analytics
  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-17504230-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

// navigation malen
function insertNavigation () {
  document.write("<a href='/' title='Psychologische Beratung'>Start</a>");
  document.writeln("<a href='/online-beratung/' title='Online-Beratung'>Online-Beratung</a>");
  document.writeln("<a href='/burnout/' title='Burnout-Symptome'>Burnout</a> ");
  document.writeln("<a href='/internet-sucht/' title='Internet-Sucht'>Internet-Sucht</a>");
  document.writeln("<a href='/stress/' title='Stress'>Stress</a>");
  document.writeln("<a href='/mobbing/' title='Mobbing'>Mobbing</a>");
  document.writeln("<a href='/hilfe/' title='Ratgeber'>Ratgeber</a>");
  document.writeln("<a href='/mehr/' title='Mehr'>Mehr...</a>");
}

//Fenster zum empfehelen von Psychomeda
function openRecommend() {
  fenster2=window.open ('recommend.html','Versenden','width=650,height=250');
  fenster2.focus();
  }

// überprüft, ob ein cookie vorhanden ist, wenn ja, wird eingeloggt
function logon() {
  if (document.cookie) {
    userCookie = document.cookie;
    // gibt es ein psychomeda cookie, das nicht gelöscht wurde und daher den Wert XRTVWS (end tag) enthälz
    if (userCookie.search('XRTVWS') > -1) {
      document.getElementsByName("loginForm")[0].style.display = "none";
      document.getElementsByName("yyy")[0].style.display = "none";
      document.getElementById("text1").style.display = "block";
      document.getElementById("text2").style.display = "none";
      document.getElementById("text3").style.display = "none";

      // psychomeda Cookie ausschneiden
      psychomedaCookie = userCookie.substring(userCookie.search('XCTZCXUZVV')+11,userCookie.search('XRTVWS'));
      psychomedaCookie = unescape(psychomedaCookie);

      if (userCookie.search('Lars') > -1) {
      // alert("userCookie: "+userCookie+" psychomedaCookie:: "+psychomedaCookie);
      }



    // den richtigen Abschnitt herausschneiden

      searchCookie = /23_([a-zA-Z0-9ßäöüÄÖÜ\_\@\.\-]+)_434_/;
      tmp = searchCookie.exec(psychomedaCookie);
      userName = RegExp.$1;

      searchCookie = /_434_(.+)/;
      tmp = searchCookie.exec(psychomedaCookie);
      userPass = RegExp.$1;

      //alert(psychomedaCookie +" "+userName+" "+userPass);
    //alert(RegExp.$1);
    //user und passwort setzen
      document.loginForm.xxx.value = userName;
      document.loginForm.yyy.value = userPass;
    //jetzt das ganze submitten
      document.loginForm.submit();

    }


  }
}

function openRating(myurl) {
  fenster2=window.open ('/cgi-bin/pt/rating_all_builtform_send_link.pl?url='+myurl,'Rating','width=650,height=250');
  fenster2.focus();
  }
