/*
  website integration code (rating form)
    yalst LiveSupportTool
    Author: Dr. Markus Jasinski
    Copyright (c) 2003-2010 by Visisoft, Rostock, Germany
    http://www.visisoft.de
*/
// Cookie handling
function setcookie6(value)
  { //v2.0
  var expDate = new Date();
  expDate.setFullYear(expDate.getFullYear() + 30);
  document.cookie = "YALSTSESSION=" + value + "; path=/; expires=" + expDate.toGMTString();
  }
function readcookie6()
  {
  var allcookies = document.cookie;
  var pos = allcookies.indexOf("YALSTSESSION=");
  if (pos != -1)
    {
    var start = pos + 13;
    var end = allcookies.indexOf(";",start);
    if (end == -1)
      end = allcookies.length;
    var value = allcookies.substring(start,end);
    if (value != "")
      {return value;}
    else
      {return "none";}
    }
  else
    {return "none";}
  }

function open_rating(url,width,height)
  {
  if (!width) width=500;
  if (!height) height=350;
  Fpopupwindow=open(url,"rating_24000_1","width="+width+",height="+height+",location=no,menubar=no,statusbar=no,scrollbars=no,dependent=no,screenX=20,screenY=20,left=20,top=20");
  if (Fpopupwindow.opener == null) Fpopupwindow.opener = self;
  Fpopupwindow.focus();
  }

function str_replace(search,replace,oldstring)
  {
  result=""+oldstring;
  while (result.indexOf(search)>-1)
    {
    pos=result.indexOf(search);
    result=""+(result.substring(0,pos)+replace+result.substring((pos+search.length),result.length));
    }
  return result;
  }

function link(rate,rcookie)
  {
  if (typeof y_pagetitle != 'undefined')
    {autotitle="&pagetitle="+escape(y_pagetitle);}
  else
    {autotitle='';}
  url2="http://rd.livesupportserver.de/yalst-dev/rating.php?site=24000-1&page=yalst-Highlights1&title=Visisoft&rating="+escape(rate)+autotitle+"&session="+escape(rcookie)+"&newlang=1&from="+escape(window.document.URL);
  var yapostroph = '\x27';
  var yquoteMark = '\x22';
  var yjavaScriptOpen = 'javascript:open_rating(';
  var ychatDimensions = ',550,540)';
  var href = "<a href='javascript:void(0)' style='color:#FFFFFF; font-size:10px; font-weight:bold; font-style:normal; font-family:Verdana, Helvetica, Arial; text-decoration: none' onClick="; // "'>
  var href = href + yapostroph + yjavaScriptOpen + yquoteMark + url2 + yquoteMark + ychatDimensions + yapostroph + '>';
  return href;
  }

function rating()
  {
  mycookie=readcookie6();
  if (mycookie=="none")
    {
    setcookie6('');
    var newcookie=readcookie6();
    if (newcookie=='')
      {mycookie=newcookie;}
    else
      { mycookie="none";}
    }
  else
    {
    if (mycookie.length!=30)
      {
      setcookie6('');
      var newcookie=readcookie6();
      if (newcookie=='')
        {mycookie=newcookie;}
      else
        {mycookie="none";}
      }
    }
  table="<table border='0' cellpadding='0' cellspacing='0' width='380'><tr><td bgcolor='#2C6060' colspan='9' style='color:#FFFFFF; font-size:10px; font-weight:bold; font-style:normal; font-family:Verdana, Helvetica, Arial'>Bitte bewerten Sie diese Seite!</td></tr>";
  table=table+"<tr><td bgcolor='#d3d8d8' style='color:#000000; font-size:10px; font-style:normal; font-family:Verdana, Helvetica, Arial' width='120'>nicht&nbsp;hilfreich</td>";
  table=table+"<td align='center' bgcolor='#600000' width='20'>"+link(1,mycookie)+"-3</a></td>";
  table=table+"<td align='center' bgcolor='#b20000' width='20'>"+link(2,mycookie)+"-2</a></td>";
  table=table+"<td align='center' bgcolor='#ff0000' width='20'>"+link(3,mycookie)+"-1</a></td>";
  table=table+"<td align='center' bgcolor='#ff9900' width='20'>"+link(4,mycookie)+"0</a></td>";
  table=table+"<td align='center' bgcolor='#00ff00' width='20'>"+link(5,mycookie)+"1</a></td>";
  table=table+"<td align='center' bgcolor='#009600' width='20'>"+link(6,mycookie)+"2</a></td>";
  table=table+"<td align='center' bgcolor='#004900' width='20'>"+link(7,mycookie)+"3</a></td>";
  table=table+"<td align='right' bgcolor='#d3d8d8' style='color:#000000; font-size:10px; font-style:normal; font-family:Verdana, Helvetica, Arial' width='120'>sehr&nbsp;hilfreich</td></tr>";
  table=table+"</table>";
  document.write(table);
  }

rating();
