var static_link = "http://www.top-ranking-internet-beratung.de/wordpress";///?cat=7";

var act_wnd = window;

function showRss(key) {
  var title = items[key].title;
	var wnd = window.open("", "Zweitfenster", "width=300,height=400,left=100,top=200,scrollbars=yes");
	wnd.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"><title>' + title + '</title><link rel="stylesheet" type="text/css" href="http://www.top-ranking-internet-beratung.de/styles.css" /><style type="text/css">body { background-image:url(); } </style></head><body style="margin: 5px;">');
  act_wnd = wnd;
  wnd.document.write(writeItem(key, items[key], true, false));
  act_wnd = window;
  wnd.document.write('<a style="position:fixed; bottom:24px;" href="#" onClick="window.close()">close</a></body></html>\n');
}

function writeItem(key, item, all, showLine) {
  var html = "";

  html += "<table cellpadding=0 cellspacing=0 width=100%><tr>";
  html += "<td><a style='color:black; font-size:80%;' class=news_link href='" + static_link + "' title='" + item.desc + "'>" + item.title + "</a></td>";

  html += "<td align=right valign=top><span class=news_date>" + item.date + "</span></td>";
  html += "</tr></table><br>";

  html += "<div class='news_text'>";

  if (all != true)
    html += "<a title='show all' class='news_text' href='javascript:this.blur(); showRss(" + key + ")'>" + item.desc.substr(0, 100) + "...</a><br>";
  else
    html += item.desc + "<br>";

  if (!showLine) html += "<hr class='news_line'>";
  html += "</div>";

  return html;
}

function writeRSS() {
  var html = "<div  style='background-color: #FAFAFA; margin-right: 16px; border: 1px solid #AAAAAA;'><h2 style='margin:0px; color: white; background-color: #B1C7C5; border-bottom: 1px solid #AAAAAA;'>Business Partner News</h2><div style='padding:4px'>";
  for (var i=0; i<items.length; i++)
    html += writeItem(i, items[i], false, i==items.length-1);

  html += "</div></div>";

  //document.getElementById("rssfeed").innerHTML = html;
  document.write(html);
}

writeRSS();
