var isEKStore=false;
var IMAGE_SERVER = "http://pics.ebaystatic.com/aw/pics/";


var altPayPal= "This seller accepts PayPal";
var altPbpEligible = "PayPal Buyer Protection Program ";
var textFreeShip = "Shipping : Free";
var textShipCost = "Shipping :";
var textShipCalc = "Shipping calculator available";
var isJSPayPal= "false";
var isJSShipCost= "true";
var isJSTrackKeyword=false;
var isJSTrackCategory=false;

var THUMB_PATH = "http://thumbs.ebaystatic.com/pict/";
var isEnding = false;
var theDate = new Date();
var eBayDate = new Date(theDate.getTime() + theDate.getTimezoneOffset() * 60000);
var eBayTimeOffset = 28800000;
var errorCode = 0;
var _sniplet = "";
var priceLabel = "Price";
var productLabel = "Product";
var pictureLabel  = "Picture";
var timeLabel = "Time Left";
var bidsLabel = "Bids";
var headerColor = "#FFFFCC";
var borderColor = "#666666";
var titleColor = "#4E4EC6";
var titleFontColor = "#FFFFFF";
var fontSize = "-1";
var fontFace = "Arial";
var fontColor = "#000000";
var textBgColor = "#FFFFFF";
var endColor = "#FF0000";
var lnkcolor = "#0000FF";
var trackingProvider = "http://www.qksrv.net/click-1798245-10381315?loc=";
var linkTarget = "_self";
var viHref = "http://cgi.ebay.com/ws/eBayISAPI.dll%3FViewItem%26item%3D";
var theWorldsMarketplace = "The World's Online Marketplace(TM)";
var searchLabel = 'Search';
var logoAltText = 'eBay Marketplace Logo';
var theDisclaimer = "disclaimer";
var ebayHome = "http://pages.ebay.com/";
var disclaimerDomain = "http://pages.ebay.com/";
var ebayHomeLogoSm = "http://pics.ebaystatic.com/aw/pics/api/MrktPlcLogoStrspnt_83x35.gif";
var ebayHomeLogoMd = "http://pics.ebaystatic.com/aw/pics/api/MrktPlcLogoStrspnt_108x45.gif";
var ebayHomeLogoLg = "http://pics.ebaystatic.com/aw/pics/api/MrktPlcLogoLtrspnt_144x59.gif";

var searchLink = "http://search.ebay.com/ws/search/SaleSearch?fsoo=1&fsop=1&fts=2&ht=0&satitle=aquarium+filter+-pond";
var tableWidth = 624;
var tableHeight = 0;
var isJSEnableFlexibleHeader=true;
var isJSEbayFlexibleHeader=true;
var logoSize=6;
var dLabel = "d" + " ";
var hLabel = "h" + " ";
var mLabel = "m" + " ";
var sLabel = "s";
var itemCount = 1317;
var varItemCount = itemCount;
var searchLinkString = "'View all ' + varItemCount + ' items on eBay'";
var searchLinkString2 = "View all";
var ekTitle = 'Coral Sea Life AuctionWatch';
var ekTitleFontSize  = "-1";
var ekTitleFontFace = "Verdana";
var isPrvdMediaPlex= false;
var isPrvdCJ= true;
var trackingID= "1798245";
var adsServed=false;
var t = new Date();
var cacheBuster = escape(t.toGMTString());
var ekWidth = "570";
var ekQuery = "aquarium filter -pond";
var ekSearchURL_Base ="http://search.ebay.com";
var ekSearchURL_Full ="http://search.ebay.com/search/search.dll";
var siteID ="0";
var ekSize=1;
var logoArr=new Array();
var hdrArr=new Array();
var imgArr=new Array();
logoArr[3]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/logoRightNowOn_57x35.gif";
logoArr[2]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/logoRightNowOn_75x45.gif";
logoArr[1]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/logoRightNowOn_98x59.gif";
logoArr[7]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrBubbleLogo_118x58.gif";
hdrArr[5]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrBubbleTiled_305x88.gif";
logoArr[6]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrStarLogo_118x58.gif";
hdrArr[4]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrStarTiled_305x88.gif";
logoArr[10]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrCDLogo_118x58.gif";
hdrArr[8]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrCDTiled_305x88.gif";
logoArr[12]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrElectronicLogo_118x58.gif";
hdrArr[10]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrElectronicTiled_305x88.gif";
logoArr[4]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrFootballLogo_118x58.gif";
hdrArr[2]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrFootballTiled_305x88.gif";
logoArr[8]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrBtnLogo_118x58.gif";
hdrArr[6]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrBtnTiled_305x88.gif";
logoArr[5]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrGameLogo_118x58.gif";
hdrArr[3]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrGameTiled_305x88.gif";
logoArr[13]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrMusicLogo_118x58.gif";
hdrArr[11]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrMusicTiled_305x88.gif";
logoArr[11]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrHouseLogo_118x58.gif";
hdrArr[9]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrHouseTiled_305x88.gif";
logoArr[9]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrRedLogo_118x58.gif";
hdrArr[7]="http://pics.ebaystatic.com/aw/pics/editorkit/hotlist/hdrRedTiled_305x88.gif";
var hdrImage="4";
var fbgcolor=textBgColor;
var hdrSrch="n";
var binIcon = "<img src=\"http://pics.ebaystatic.com/aw/pics/bin_15x54.gif\" border=\"0\" hspace=\"6\" vspace=\"0\" align=\"absbottom\"/>";
var nnIcon = "<img src=\"http://pics.ebaystatic.com/aw/pics/nn.gif\" border=\"0\" hspace=\"6\" vspace=\"0\" align=\"absbottom\"/>";

 function Localize(pStr)
	 {
		 return pStr;
	}
function _alert(str) {
//	alert(str);
}

//#EK Keyword
function _appendKC(link)
{
	if (isJSTrackKeyword)
	{
		link+="&kw="+textTrackKeyword;
	}
	if (isJSTrackCategory)
	{
		link+="&cat="+textTrackCategory;
	}
	return link;
}

function _setImageSize(imgObject, imgHeight, imgWidth)
{
	imgObject.resized=true;
	imgObject.height=imgHeight;
	imgObject.width=imgWidth;
	return;
}

function _checkLogo(imgObject, minHeight, maxHeight, minWidth, maxWidth)
{
	var imgHeight=imgObject.height;
	var imgWidth=imgObject.width;
	if (imgHeight>maxHeight)
	{
		var tmpWidth=Math.round(1.0*maxHeight*imgWidth/imgHeight);
		if (tmpWidth>maxWidth)
			return _setImageSize(imgObject, Math.round(1.0*maxWidth*imgHeight/imgWidth), maxWidth);
		if (tmpWidth<minWidth)
			return _setImageSize(imgObject, maxHeight, minWidth);
		return _setImageSize(imgObject, maxHeight, tmpWidth);
	}
	if (imgWidth>maxWidth)
	{
		var tmpHeight=Math.round(1.0*maxWidth*imgHeight/imgWidth);
		return _setImageSize(imgObject, tmpHeight>minHeight?tmpHeight:minHeight, maxWidth);
	}
	if (imgWidth<minWidth)
	{
		var tmpHeight=Math.round(1.0*minWidth*imgHeight/imgWidth);
		if (tmpHeight>maxHeight)
			return _setImageSize(imgObject, maxHeight, minWidth);
		return _setImageSize(imgObject, tmpHeight, minWidth);
	}
}
//$EK Keyword

function _genLink(href, caption) {
var link = "";
 if (isPrvdMediaPlex)
 {
     if (adsServed)
     {
         link = "<a href=\"" +  trackingProvider + "mpt=" + cacheBuster + "&mpro=" + href;
     }
     else
     {
         link = "<a href=\"" +  trackingProvider + "loc=" + href;
     }
 }
 else
 {
     link = "<a href=\"" +  trackingProvider + href;
 }
  if (isPrvdCJ && (sid != null && sid != ""))
 {
   link += "&SID=" + sid;
 }

//#EK Keyword
link=_appendKC(link);
//$EK Keyword

 if (linkTarget != "_self") {
	link += "\" target=\"" + linkTarget;
 }
 //link += "\">" + caption + "</a>";
  link += "\" style=\"color:"+lnkcolor+"\">" + caption + "</a>";
 _alert(link);
 return link;
}
function _genItemLink(itemId, title) {
 var link = "";
	if (isEKStore)
	{
		link = "<a href=\"" + unescape(viHref.replace(/\+/g,  " ")) + itemId+"&refid=store";
		if (linkTarget != "_self") {
			link += "\" target=\"" + linkTarget;
		}
		link += "\" style=\"color:"+lnkcolor+"\">" + title + "</a>";
		return  link;
	}

 if (isPrvdMediaPlex)
 {
     if (adsServed)
     {
         link = "<a href=\"" +  trackingProvider + "mpt=" + cacheBuster + "&mpro=" + viHref + itemId;
     }
     else
     {
         link = "<a href=\"" +  trackingProvider + "loc=" + viHref + itemId;
     }
       if (isPrvdCJ && (sid != null && sid != ""))
       {
         link += "&SID=" + sid;
       }
//#EK Keyword
link=_appendKC(link);
//$EK Keyword
     if (linkTarget != "_self") {
    	link += "\" target=\"" + linkTarget;
     }
     // link += "\">" + title + "</a>";
 }
 else
 {
     link = "<a href=\"" +  trackingProvider + viHref + itemId;
     if (isPrvdCJ && (sid != null && sid != ""))
       {
         link += "&SID=" + sid;
       }
//#EK Keyword
link=_appendKC(link);
//$EK Keyword
     if (linkTarget != "_self") {
    	link += "\" target=\"" + linkTarget;
     }
    // link += "\">" + title + "</a>";
 }

 link += "\" style=\"color:"+lnkcolor+"\">" + title + "</a>";
  _alert(link);
 return  link;
}

function _getPaypalInfo(pbpEligible, ppEligible) {
	var str ="";
	if(isJSPayPal == 'true'){
		if(pbpEligible == 'true'){
		  		str += '<img height="16" width="28" border="0" src="'+IMAGE_SERVER+'paypal/logo_paypalPPBuyerProtection_28x16.gif" ';
				str +=	'  alt="'+altPbpEligible+ '"/>';
		//str += '<img height="16" width="28" border="0" src="http://pics.ebaystatic.com/aw/pics/paypal/logo_paypalPPBuyerProtection_28x16.gif"/>';
		} else {
			if( ppEligible == 'true'){
				str += '<img height="16" width="16" border="0" src="'+IMAGE_SERVER+'paypal/logo_paypalPP_16x16.gif"';
				str +='  alt="'+altPayPal+'"/>';
			}
		}
	}
 return str;
}
function mbSubStr(strIn, start, end)
{
	++start;
	if (start>=end)
		return "";
	var str="";
	var count=0;
	var isSub=false;
	for (var i=0; i<end&&i<strIn.length; ++i)
	{
		count+=strIn.charCodeAt(i)>=128?2:1;
		if (count==start)
			isSub=true;
		if (!isSub&&count==start+1)
			isSub=true;
		if (isSub)
			str+=strIn.charAt(i);
		if (count>=end)
			break;
	}
	return str;
}
function _getShipPrice(price,shipPrice,shippingType){
	var strShip ="";
	if(isJSShipCost =='true'){
		if ( shippingType == '0' ) {
			strShip += '<a/><font style="cursor:hand">' + price + '</font></a>';
		} else if ( shippingType == '2' ) {
			strShip += '<a title="'+textShipCalc+'" /><font style="cursor:hand">' + price + '</font></a>';
		} else if(shippingType == '3'){
			strShip += '<a title="' +textFreeShip+'" /><font style="cursor:hand">' + price + '</font></a>';
		} else {
			//NOT_SPECIFIED == 0;   FLAT_RATE == 1;  CALCULATED_RATE == 2
			// By depending on shippingFee to be 0 or 1; we do not care whether
			// BE sets shippingType to 0 or 1.
			// We will detect free shipping by checking if shippingFee is null.
			if ( shipPrice != '') {
				strShip += '<a title="'+textShipCost+ shipPrice +'" /><font style="cursor:hand">' + price + '</font></a>';
			} else  {
				strShip += '<a/><font style="cursor:hand">' + price + '</font></a>';
			}
		}
	}else{
		strShip += price ;
	}
	return strShip;
}

function _docWrite(str) {
  _sniplet += str;
  if (fooStr) alert(str);
}
var fooStr = false;
function _getSniplet() {
  _eBaySniplet();
//  alert(bestitem);
//  alert(sid);
//  alert(besttitle);
//  alert(bestprice);
//  alert(bestbids);

    besttitle = besttitle.replace( /\'/g, "&quot;" );
//  alert(besttitle);
  
  var loc="http://coralsealife.com/cgi-bin/featured.pl?h=http://www.qksrv.net/click-1798245-10381315?loc=http://cgi.ebay.com/ws/eBayISAPI.dll%3FViewItem%26item%3D"+
  bestitem+"&SID="+sid+"&T="+besttitle+"&P="+bestprice+"&B="+bestbids;
  _docWrite("<script language=javascript>"+"document.getElementById('FITEM').src='"+loc+"';</script>");

  return _sniplet;
}
function _write(str) {
  _docWrite('<font class="ebayText" face="' + fontFace + '" size="' + fontSize + '" color="' + fontColor + '">' + str +
'</font>');
}
function _writeWithColor(str, textColor) {
  _docWrite('<font class="ebayText" face="' + fontFace + '" size="' + fontSize + '" color="' + textColor + '">' + str +
'</font>');
}
function _spacer(w, h) {
  return '<img border="0" height="' + h + '" width="' + w + '" src="http://pics.ebaystatic.com/aw/pics/spacer.gif">';
}
function _cleanTitle(str) {
  var title = new String(str);
  return title.replace(/\*/g, "&quot;");
}
function _rowDiv(colSpan) {
	_docWrite('<tr><td colspan="' + colSpan + '" bgcolor="' + borderColor + '">' + _spacer("100%", 1) + '</td></tr>');
}
function _tracking()
{
  //alert("isPrvdMediaPlex" + isPrvdMediaPlex + " adsServed: " + adsServed);
  var str = "";
  if (isPrvdMediaPlex)
  {
      if (adsServed)
      {
           str = '<img src="http://adfarm.mediaplex.com/ad/tr/'+trackingID+'?mpt='+cacheBuster+'" border="0" height="1" width="1"/>';
      }
      else
      {
          str = '<img src="http://adfarm.mediaplex.com/ad/tr/'+trackingID+'" border="0" height="1" width="1"/>';
      }
  }
  return str;
}

function _header() {

    _docWrite('<table><tr><td colspan="3"><table>');

}
function _footer(disClaimerHelper) {
  _docWrite('</table>');
  _docWrite('</td></tr><tr bgcolor="#FFFFFF"><td>');
  _write(_genLink(escape(searchLink), eval(searchLinkString) ));
  _docWrite('</td><td>&nbsp;</td><td>');
  _write(_genLink(escape(disclaimerDomain + "help/community/editorkitlegal.html"), '<i>' + theDisclaimer + '</i>'));
  _docWrite('</td></tr>');
  _docWrite('</table>');

}
function _disclaimer(colSpan, disclaimer) {
  _docWrite('<tr><td width="1" bgcolor="' + borderColor + '">' + _spacer(1, 1) + '</td>');
  _docWrite('<td colspan="3" valign="bottom">');
  _docWrite('<table cellpadding="0" cellspacing="0" border="0" width="100%">');
  //_docWrite('<tr><td height="1" colspan="4" bgcolor="'+borderColor+'"/></tr><tr></tr>');

  if (errorCode > 0) {
	//_docWrite('<td align="right">' + errorCode + '</td>');
  }
  else {
    _docWrite('<td bgcolor="' + fbgcolor + '">' + _spacer(10, 1) + '</td><td bgcolor="' + fbgcolor + '">');
    if (itemCount > 0) {
      _write(_genLink(escape(searchLink), eval(searchLinkString) ));
    }
    else {
      _write(_spacer(1, 1));
    }
    _docWrite('</td>');
    if (disclaimer && itemCount > 0) {
      _docWrite('<td align="right" bgcolor="' + fbgcolor + '">');
      _write(_genLink(escape(disclaimerDomain + "help/community/editorkitlegal.html"), '<i>' + theDisclaimer + '</i>'));
	  _docWrite('</td>');
    }
    _docWrite('<td bgcolor="' + fbgcolor + '">' + _spacer(10, 1) + '</td>');
  }
  _docWrite('</tr></table>');
  _docWrite('</td>');
  _docWrite('<td width="1" bgcolor="' + borderColor + '">' + _spacer(1, 1) + '</td></tr>');
}
function _worldMarketPlaceLink() {
	itemCount = 0;
    _docWrite("<div align='center'>" + _spacer(5,5) + "<p>");
		_docWrite(_genLink(ebayHome, theWorldsMarketplace));
		_docWrite("<p></div>");
}

function strTrim()
{
	// Match space at the beginning and end of a string and replace it with
	// empty strings.
	return this.replace(/^\s+/, '').replace(/\s+$/, '');
}
String.prototype.trim  = strTrim;

//#EK Keyword
function _nullSearch(formObj)
{
	var trackingSearchLink=trackingProvider;
	var queryString=formObj.satitle.value;
	var nullQuery=encodeURIComponent(queryString);
	var nullSearchLink=encodeURIComponent(ekSearchURL_Full+"?satitle="+queryString);
	if (isPrvdMediaPlex)
	{
		if (adsServed)
			trackingSearchLink+="mpt="+cacheBuster+"&mpro="+nullSearchLink;
		else
			trackingSearchLink+="loc="+nullSearchLink;
	}
	else
		trackingSearchLink+=nullSearchLink;
	if (isPrvdCJ&&(sid!=null&&sid!=""))
		trackingSearchLink+="&SID="+sid;
	if (isJSTrackKeyword)
		trackingSearchLink+="&kw="+nullQuery;
	if (isJSTrackCategory)
		trackingSearchLink+="&cat="+textTrackCategory;
	formObj.action='javascript: document.location="'+encodeURIComponent(trackingSearchLink)+'"';
	return true;
}
//$EK Keyword

function _ShowSearchBox() {
	itemCount = 0;

    _docWrite('<div align="center">' + _spacer(8,5) + '<p>');
//#EK Keyword
	var trackingProviderReal=isPrvdMediaPlex?trackingProvider.slice(0, -2):trackingProvider;
	_docWrite('<form class="nomargin" method="get" name="EditorKitSearch" action="'+trackingProviderReal+'" onsubmit="return _nullSearch(this)">');
//$EK Keyword
	_docWrite('<input type="text" style="width:'+(ekWidth-88)+'px" name="satitle" value="'+ekQuery+'"/>'+_spacer(8,8)+'<input type="submit" name="search" value='+searchLabel+' style="width:64px"/></form>');
	_docWrite("<p></div>");
}

function _padNumber(theNumber) {
	if (theNumber < 10)
		return "0" + theNumber;
	return theNumber;
}
function _getTimeLeft(itemDate) {

	isEnding = false; //reset global for font color
	var offSetTime = itemDate.getTime() + eBayTimeOffset;  //offset for pst.
	//var offSetTime = itemDate.getTime() ;
	var diffTime = offSetTime - eBayDate.getTime();
	var seconds = Math.floor(diffTime / 1000) % 60;
	var minutes = Math.floor(diffTime / (60 * 1000)) % 60;
	var hours = Math.floor(diffTime / (60 * 60 * 1000)) % 24;
	var days = Math.floor(diffTime / (24 * 60 * 60 * 1000));
	if (diffTime < 3600000 /* msec */)
		isEnding = true; // set global for font color
	var timeLeft = _spacer(8, 1);
	if (days > 0) {
		timeLeft = timeLeft + days + dLabel + _padNumber(hours) + hLabel + _padNumber(minutes) + mLabel;
	}
	else if (hours > 0)	{
		timeLeft = timeLeft + hours + hLabel + _padNumber(minutes) + mLabel;
	}
	else if (minutes > 0)	{
		timeLeft = timeLeft + minutes + mLabel;
	}
	else {
		timeLeft = timeLeft + "<01" + mLabel;
	}
	return timeLeft;
}
function _genImg(imgInfo,itemId)
{
  var str = "";
  str +=  _spacer(5,1);
  if (imgInfo == 2)
  {
    //display Item image
    str += '<img width="64" height="64" border="0" src="'+THUMB_PATH+''+itemId+'.jpg"/>';
  }
  else if (imgInfo == 1)
  {
    // display camera icon
    str += '<img height="15" width="64" border="0" src="'+IMAGE_SERVER+'lst/_p__64x15.gif"/>';
  }
  else
  {
    // display spacer image
    str += '<img width="64" height="64" border="0" src="'+IMAGE_SERVER+'editorkit/hotlist/imgSamplePic_64x64.gif"/>';
  }
  str +=  _spacer(5,1);

    return _genItemLink(itemId,str);

}


function _writeWithColor2(str, textColor) {
  _docWrite('<font class="ebayText" face="' + fontFace + '" size="1" color="' + textColor + '">' + str +
'</font>');
}
function _write2(str) {
  _docWrite('<font class="ebayText" face="' + fontFace + '" size="1" color="' + fontColor + '">' + str +
'</font>');
}

function _genHeaderLogo(ebayHome, logoAltText)
{
	var hi;
	str= '<img alt=" '+logoAltText+' " border="0" src=" ' + logoArr[logoSize] + ' ">';
	if(logoSize<=3)
		str=_spacer(5, 1)+str;
	str=_genLink(ebayHome, str);
	if(logoSize>3)
	{

		str='<div STYLE="height:54px; width: 118px; overflow: hidden;">'+str+'</div>';
	}
	_docWrite(str);
}
function _genHeaderLogoCustomized(ebayHome, logoAltText)
{
	var hi;
	str= '<img alt=" '+logoAltText+' " border="0" src=" ' + logoArr[logoSize] + ' ">';
	if(logoSize<=3)
		str=_spacer(5, 1)+str;
	str=_genLink(ebayHome, str);
	if(logoSize>3)
	{
		str='<div STYLE="height:58px; width: 118px; overflow: hidden;">'+str+'</div>';
	}
	_docWrite(str);
}
function _genHeaderLogo2(ebayHome, logoAltText, headerW)
{
	var hi;
	str= '<img alt=" '+logoAltText+' " border="0" src=" ' + logoArr[logoSize] + ' ">';
	if(logoSize<=3)
		str=_spacer(5, 1)+str;
	str=_genLink(ebayHome, str);
	if(logoSize>3)
	{
		var hei;
		if(headerW==83)
		{
		   str='<div STYLE="width: '+headerW+'px; overflow: hidden;">'+str+'</div>';
		}
		else
		{
			str='<div STYLE=" width: '+headerW+'px; overflow: hidden;">'+str+'</div>';
		}

	}
	_docWrite(str);
}
  // display type 8
function _labels8() {
}
function _disclaimer8() {
  _disclaimer(8, true);
}

var _tabx=0;
var _taby=0;
var besttitle;
var bestprice=0;
var bestnprice;
var bestbids=0;
var bestitem=0;

function _item8(itemId, title, price, shipPrice,shippingType, endTime, bidCount, imgInfo,pbpEligible,ppEligible) {
  var timeColor = (isEnding ? endColor : fontColor);
  
  var nprice = parseFloat(price.substr(1));

  if(0 == bestitem)
  {
    bestitem =itemId;
    bestprice=price;
    bestnprice=nprice;
    besttitle=title;
    if( bidCount == ((bidCount+1)-1))
    {
        bestbids=bidCount;
    }
    else
    {
        bestbids=1;
    }
  }

  if(!_tabx)
  {
    _docWrite('<tr>');
    if(_taby == 0)
    {
        _docWrite('<td>&nbsp;</td>');
        _tabx=1;
    }
    if(_taby == 1)
    {
        _docWrite('<td colspan="4"><iframe id="FITEM" class="FITEM" border="0" frameborder="0"></iframe></td></tr><tr>');
    }
  }
     
  _tabx += 1;
  if(_tabx == 4)
  {
    _tabx=0;
    _taby++;
  }
  
  _docWrite('<td width="200px" valign="top" style="border:solid 1px #88c;background:#FFF;">');
  _docWrite('<table height="150px" width="100%"><tr><td colspan=2 height="50px" align="center" style="border:solid 1px #12F;background:#cdf;">');
  _write(_genItemLink(itemId, _cleanTitle(title)));
  _docWrite('</td></tr><tr><td rowspan=2>');
  _docWrite(_genImg(imgInfo,itemId));
  _docWrite('</td><td>');
  _write(_getShipPrice(price, shipPrice,shippingType));
  _docWrite('</td></tr><tr><td>');
  _write(bidCount);
  if( bidCount == ((bidCount+1)-1))
  {
    if(bidCount == 1)
    {
        _docWrite(' bid');
    }
    else
    {
        _docWrite(' bids');
    }
    
    
    if((nprice*bidCount)>(bestnprice*bestbids))
    {
        bestbids=bidCount;
        bestprice=price;
        bestnprice=nprice;
        besttitle=_cleanTitle(title);
        bestitem =itemId;
    }
    
  }
  else
  {
    if(price>(bestprice*bestbids))
    {
        bestbids=1;
        bestprice=price;
        bestnprice=nprice;
        besttitle=_cleanTitle(title);
        bestitem =itemId;
    }
  }
  _docWrite('</td></tr><tr><td align="center" colspan=2 height="20px" style="background:#ddd;color:'+timeColor+'"');

  _writeWithColor(endTime, timeColor);
  _docWrite('</td></tr></table></td>');

  if(!_tabx)
  {
    _docWrite('</tr>');
    
  }
}

