document.open();
document.write('<style type=\"text/css\">');  
document.write('div.motorsport-news { list-style-type: none; margin: 0; padding: ' + ticker_padding + 'px; width: ' + ticker_breite + 'px; background: ' + ticker_backgroundcolor + '}');        
document.write('div.motorsport-newsblock { padding: 0; margin: 0px 0px ' + abstand_news + 'px 0px; clear: both; }');   
document.write('p.adrivo-dachzeile { line-height: ' + dachzeile_font_size + 'px; margin-bottom: 2px; margin-top:0; padding-top:0; font-family:' + dachzeile_font_family + '; font-size: ' + dachzeile_font_size + 'px; color: ' + dachzeile_font_color + '; }');
document.write('a.adrivo-headline { font-family:' + headline_font_family + '; font-size: ' + headline_font_size + 'px; color: ' + headline_font_color + '; font-weight: ' + headline_bold + '; text-decoration: ' + headline_underline + '; }');
document.write('a.adrivo-teaser { font-family:' + teaser_font_family + '; font-size: ' + teaser_font_size + 'px; color: ' + teaser_font_color + '; text-decoration: ' + teaser_underline + '; }');
document.write('a:hover { color: ' + links_hover_color +'; }'); 
document.write('span.adrivo-datum { font-family:' + datum_font_family + '; font-size: ' + datum_font_size + 'px; color: ' + datum_font_color + '; font-style: ' + datum_kursiv + '}');
document.write('div.image { float: left; display: inline; margin: 0px 10px 0px 0px; }');
document.write('</style>');
document.close();

var hoehe = parseInt(fotos_breite*0.75);
var topnews_id = 0;

function trennlinie() {
   document.write('<div style="font-size:0px; line-height: 0px; height:1px; margin-bottom: 10px; background-color:' + news_trennlinie_backgroundcolor + ';');
   if (news_trennlinie_url!='') {
      document.write('background: url(' + news_trennlinie_url + ') repeat-x');
   }
   document.write('"></div>');
}


document.write('<div class="motorsport-news">');

   try {
     if (text_encoding=='utf8') {
     	   dachzeile = dachzeile_utf8;
	   headline = headline_utf8;
	   teaser = teaser_utf8;
     }
   } catch (e) { } 

   // top article
   if (news_sortierung=='topnews' && top_article[0]) {
   
      topnews_id = top_article[0];
   
   
	   // show top article
	   if (dachzeile[0].length>0) {
	      for (i=0; i<=news_anzahl-1; i++) {
	      
	         if (topnews_id==id[i]) {
	         
	            if (datum_einblenden!='nein') {
	               if (datum_einblenden=='nur_datum') {
	                  var d = datum[i].substr(0,10);
	               }
	               if (datum_einblenden=='datum_und_uhrzeit') {
	                  var d = datum[i];
	               }   
	               d = datum_einkapselung.substr(0,1) + d + datum_einkapselung.substr(1,1);
	            }
	         
	            if (articlelink[i].length>0 && headline[i].length>0) {
	               document.write('<div class="motorsport-newsblock">');
	               
	                  if (fotos_anzeigen==1) {
	                     document.write('<div class="image"><a href="' + articlelink[i] + '" target="_blank"><img src="http://www.motorsport-magazin.com/images/' + fotos_breite + '/' + hoehe + '/q_75/' + foto[i] + '" style="border: 0px;" /></a></div>');
	                  }
	                  
					  document.write('<div class="news">');
	                  if (datum_position=='vor_dachzeile' && datum_einblenden!='nein') document.write('<span class="adrivo-datum">' + d + '</span>&nbsp;');
	                  document.write('<p class="adrivo-dachzeile">' + dachzeile[i] + '</p>');      
	                  if (datum_position=='hinter_dachzeile' && datum_einblenden!='nein') document.write('&nbsp;<span class="adrivo-datum">' + d + '</span>');
	                  
	                  if (datum_position=='vor_headline' && datum_einblenden!='nein') document.write('<span class="adrivo-datum">' + d + '</span>&nbsp;');
	                  document.write('<a href="' + articlelink[i] + '" class="adrivo-headline" target="_blank">' + headline[i] + '</a>'); 
	                  if (datum_position=='hinter_headline' && datum_einblenden!='nein') document.write('&nbsp;<span class="adrivo-datum">' + d + '</span>');
	                        
	                  document.write('<br />');    
	                  
	                  if (teaser_anzeigen==1) {
	                     if (datum_position=='vor_teaser' && datum_einblenden!='nein') document.write('<span class="adrivo-datum">' + d + '</span>&nbsp;');
	                     document.write('<a href="' + articlelink[i] + '" class="adrivo-teaser" target="_blank">' + teaser[i] + '</a>');      
	                     if (datum_position=='hinter_teaser' && datum_einblenden!='nein') document.write('&nbsp;<span class="adrivo-datum">' + d + '</span>');
	                  }
		               document.write('</div><div style="clear:both;"></div>');
	               document.write('</div>');
	               
	               if (news_trennlinie_anzeigen==1) {
	                  trennlinie();
	               }               
	            }
	         }
	      }
	   }
   
   
   
   }

   // other articles
   if (dachzeile[0].length>0) {
      for (i=0; i<=news_anzahl-1; i++) {
      
         if (topnews_id!=id[i]) {
         
            if (datum_einblenden!='nein') {
               if (datum_einblenden=='nur_datum') {
                  var d = datum[i].substr(0,10);
               }
               if (datum_einblenden=='datum_und_uhrzeit') {
                  var d = datum[i];
               }   
               d = datum_einkapselung.substr(0,1) + d + datum_einkapselung.substr(1,1);
            }
         
            if (articlelink[i].length>0 && headline[i].length>0) {
               document.write('<div class="motorsport-newsblock">');
               
                  if (fotos_anzeigen==1) {
                     document.write('<div class="image"><a href="' + articlelink[i] + '" target="_blank"><img src="http://www.motorsport-magazin.com/images/' + fotos_breite + '/' + hoehe + '/q_75/' + foto[i] + '" style="border: 0px;" /></a></div>');
                  }
                  
				  document.write('<div class="news">');
                  if (datum_position=='vor_dachzeile' && datum_einblenden!='nein') document.write('<span class="adrivo-datum">' + d + '</span>&nbsp;');
                  document.write('<p class="adrivo-dachzeile">' + dachzeile[i] + '</p>');      
                  if (datum_position=='hinter_dachzeile' && datum_einblenden!='nein') document.write('&nbsp;<span class="adrivo-datum">' + d + '</span>');
                  
                  if (datum_position=='vor_headline' && datum_einblenden!='nein') document.write('<span class="adrivo-datum">' + d + '</span>&nbsp;');
                  document.write('<a href="' + articlelink[i] + '" class="adrivo-headline" target="_blank">' + headline[i] + '</a>'); 
                  if (datum_position=='hinter_headline' && datum_einblenden!='nein') document.write('&nbsp;<span class="adrivo-datum">' + d + '</span>');
                        
                  document.write('<br />');    
                  
                  if (teaser_anzeigen==1) {
                     if (datum_position=='vor_teaser' && datum_einblenden!='nein') document.write('<span class="adrivo-datum">' + d + '</span>&nbsp;');
                     document.write('<a href="' + articlelink[i] + '" class="adrivo-teaser" target="_blank">' + teaser[i] + '</a>');      
                     if (datum_position=='hinter_teaser' && datum_einblenden!='nein') document.write('&nbsp;<span class="adrivo-datum">' + d + '</span>');
                  }
	               document.write('</div><div style="clear:both;"></div>');
               document.write('</div>');
               
               if (news_trennlinie_anzeigen==1) {
                  trennlinie();
               }               
            }
         }
      }
   }
      else {
         document.write('<li>Momentan keine Artikel vorhanden.</li>');
      }   

document.write('</div>');	  
