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 plusenc(text)
  {result=str_replace('+','%2B',text); return result;}
// Cookie handling
function setcookie(value)
  { //v2.0
  var expDate=new Date();
  expDate.setFullYear(expDate.getFullYear()+30);
  document.cookie="YALSTSESSION="+value+"; path=/; expires="+expDate.toGMTString();
  }
function readcookie()
  {
  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_livechat(urlparm,width,height)
  {
  if (!width) width=500;
  if (!height) height=350;
  Fpopupwindow=open(urlparm,"livechat_24365_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 yalst()
  {
  extpage='';
  if (typeof y_pagetitle!='undefined')
    {autotitle="&pagetitle="+escape(y_pagetitle);}
  else
    {autotitle='';}
  if (typeof y_comment!='undefined')
    {
    if (y_comment.length<=80)
      {addcomment="&comment="+escape(y_comment);}
    else
      {addcomment="&comment="+escape(y_comment.substr(0,80));}
    }
  else
    {addcomment="";}
  urlstring="http://rd.livesupportserver.de/yalst/index.php?yinit=true&site=24365-1&external=ebay&direct=true&visitor=Besucher&from="+plusenc(escape(window.document.URL))+autotitle+addcomment;
  var yapostroph='\x27';
  var yquoteMark='\x22';
  var yjavaScriptOpen='javascript:open_livechat(';
  var ychatDimensions=',550,530)';
  var aopen="<a href='javascript:void(0)' title='Rundreise-Beratung - hier klicken' onClick="; // "'>
  var aopen=aopen+yapostroph+yjavaScriptOpen+yquoteMark+urlstring+yquoteMark+ychatDimensions+yapostroph+'>';
  image='<img name="supportbutton" src="http://rd.livesupportserver.de/yalst/button.php?site=24365-1&external=ebay&ypi=no&t=1283462689'+autotitle+extpage+'" border="0">';
  document.write("<!-- yc"+"b -->");
  document.write(aopen);
  document.write(image);
  document.write('</a>');
  document.write("<!-- yc"+"e -->");
  }
yalst();
