// Display Sophos top 10 virus/hoax etc. feeds
// ©2002, Lynmar Computer Solutions

// usage: SavFeed('top' ¦ 'old' ¦ 'hoax', <number of items>)

function SavFeed(t, count) {
  
  var txt = "";
  var rankcol = 'yes'	// display ranking column
  var colspan = ((rankcol=="no") ? 1 : 2);  
  count   = ((count<1 ) ? 1 : ((count>10) ? 10 : count));
  
  if (t=='top') { 
//	call("http://www.sophos.com/virusinfo/infofeed/tenalerts.js");
	var x=tenalerts; 
	var heading='<b>Top ' + ((count==1) ? 'virus' : count+' viruses') + ' this month</b>';
  } else { 
  	if (t=='old') {
//		call("http://www.sophos.com/virusinfo/infofeed/topten.js");
		var x=topten; 
		var heading='<b>Top ' + ((count==1) ? 'virus' : count+' viruses') + ' of ' + month + '</b>';
  	} else {
  		if (t=='hoax') {
//			call("http://www.sophos.com/virusinfo/infofeed/hoax.js");
			var x=hoax;
			var heading='<b>Current Top ' + ((count==1) ? 'hoax' : count+' hoaxes') + '</b>';
  		} else {
			t='error';
			var heading='<b>usage: SavFeed("top" ¦ "old" ¦ "hoax", \<list-size\>) </b>';
  		}
	}
  }
  
  txt += '<table border="0" class="savtable" cellspacing="2" cellpadding="4">';
  txt += '<tr><td colspan="' + colspan + '" class="savhead">' + heading + '</td></tr>';
  for (var i=0; i<x.length; i+=3) {
    if (i < count*3) {
       txt += '<tr>';
       if (rankcol == "yes") { txt += '<td class="savdata"><nobr>' + x[i+0] + '</nobr></td>' }
       txt += '<td class="savdata"><a href="' + x[i+2] + '"><nobr>' + x[i+1] + '</nobr></a></td></tr>';
    } else {
       break;
    }
  }
  
  txt += '<tr><td colspan="' + colspan + '" class="savhead">Source: <a href="http://www.sophos.com">Sophos Anti-Virus</a></td></tr>';
//txt += '<tr><td colspan="' + colspan + '" class="savhead"><a href="http://www.sophos.com/virusinfo/infofeed/">Add this info to your website</a></font></td></tr>';
  txt += '</table>';
  document.write(txt);
}
//end.
