var adSource; function AdsItem(pImgSrc, pImgW, pImgH, pItemLink, pItemTitle, pPriceTitle, pPrice, pTimeLeft, pNumBids, pImgType) { this.imgSrc = pImgSrc; this.imgW = pImgW; this.imgH = pImgH; this.itemLink = pItemLink; this.itemTitle = pItemTitle; this.priceTitle = pPriceTitle; this.price = pPrice; this.timeLeft = pTimeLeft; this.numBids = pNumBids; this.imgType = pImgType; this.init = function() { var i = this.price.indexOf('.00'); if (i==(this.price.length-3)) this.price = this.price.substring(0, i); } this.init(); } function AdsLink(pLink, pText) { this.link = pLink; this.text = pText; } function getTitle(pTitle, pCount) { var p = pTitle.length>pCount?'...':''; return pTitle.substring(0, pCount)+p; } function textTrunc(str, count){ if(count <= str.indexOf('') || (str.indexOf('')==-1 && str.length>count)) return str.substring(0, count)+'...'; else if(count > str.indexOf('') && count < str.indexOf('')-2) count+=3; else if(count > str.indexOf('')-5) count+=7; var p = str.length>count?'...':''; var newStr = str.substring(0, count); if(newStr.indexOf('')>-1) if(newStr.indexOf('')<0) newStr = newStr+''+p; else newStr = newStr+p; return newStr; } function ca_clickSearch(pElem) { if (pElem) pElem.value=''; return true; } function AdsTab(pKeyword,pKeywordLink,pItemCount) { this.sKeyword = pKeyword; this.sKeywordLink = pKeywordLink; this.iItemCount = pItemCount; this.aItemList = new Array(); this.aCategoryList = new Array(); this.AddItem = function(pImgSrc,pItemLink,pItemTitle,pPriceTitle,pPrice,pTimeLeft, pNumBids,pImgType) { if (this.aItemList.length < this.iItemCount) this.aItemList[this.aItemList.length] = new AdsItem(pImgSrc,80,80,pItemLink,pItemTitle,pPriceTitle,pPrice,pTimeLeft, pNumBids,pImgType); } this.AddCategory = function(pLink, pText) { this.aCategoryList[this.aCategoryList.length]=new AdsLink(pLink,pText); } this.AttachCategory = function(pCategory) { this.aCategoryList = pCategory; } } function Localize(pStr) { return pStr; } function ca_GoSearch(pURL, pKW) { var k = 'satitle='; var i = pURL.indexOf(k); if (i < 0) { k = 'satitle%3D'; i = pURL.indexOf(k); } if (i > 0) { var pre = pURL.substring(0, i+k.length); var pos = pURL.substring(pre.length, pURL.length); var e = null; if (document.all) e = document.all[pKW]; if (!e && document.getElementById) e = document.getElementById(pKW); if (e) { window.open(pre+encodeURIComponent(encodeURIComponent(e.value))+pos,"search"); } } return true; } function ca_GoSearchOnEnterKey(currentEvent, pURL, pKW) { if(currentEvent.keyCode == 13) { return ca_GoSearch(pURL, pKW); } } function AdsImageText120_600() { this.bgColor = "FFFFFF"; this.borderColor = "000099"; this.textColor = "000000"; this.linkColor = "0000FF"; this.priceColor = '#990000'; this.stripeMulti = true; this.fontFamily = "Arial";this.itemTitleSize = '13px';this.titleSize = '11px';this.priceTitleSize = '10px';this.priceSize = '13px';this.timeSize = '10px';this.logoTextSize = '9px';this.rightNowSize = '12px';this.urlSize = '10px';this.searchForSize = '10px' this.spaceImg = "http://pics.ebaystatic.com/aw/pics/s.gif"; this.logoSrc = "http://pics.ebaystatic.com/aw/pics/logos/logoRightNowOn_75x42.gif"; this.logoSrcL = "http://pics.ebaystatic.com/aw/pics/logos/logoRightNowOn_98x54.gif"; this.searchForText = 'Search eBay for:'; this.shopAtText = 'Shop at eBay for:'; this.logoText = 'eBay AdContext'; this.logoLink = 'http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fpages.ebay.com%2F'; this.VMLink = 'http://sofe.ebay.com/ws/eBayISAPI.dll?SojRedirect&cid=1066&ebayredir=http://affiliates.ebay.com/ads/adcontext?SSPageName=Contextad_hub'; this.searchLink = 'http://search.ebay.com/search/search.dll?satitle='; this.sepCharacter = ', '; this.adWindowText = 'eBay AdContext'; this.rightNowText = 'right now on eBay'; this.searchBoxText = 'Search eBay'; this.searchBoxLink = 'http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fsearch.ebay.com%2Fsearch%2Fsearch.dll%3Fsatitle%3D%26ast%3Dd'; this.searchButtonText = 'Go'; this.findItButtonText = 'Find It'; this.browseMoreText = 'Browse more:'; this.start_Line1A_CreativeText = 'Looking for '; this.start_Line1B_CreativeText = 'Find exactly what you want today!'; this.start_Line1C_CreativeText = ''; this.start_Line2A_CreativeText = ''; this.start_Line2B_CreativeText = ''; this.start_Line2C_CreativeText = ''; this.start_Line3A_CreativeText = 'Find exactly what you want on eBay.'; this.start_Line3B_CreativeText = 'Shop eBay today!'; this.start_Line3C_CreativeText = ''; this.mid_Line1A_CreativeText = ''; this.mid_Line1B_CreativeText = ''; this.mid_Line1C_CreativeText = 'search.ebay.com/'; this.mid_Line2A_CreativeText = ' available.'; this.mid_Line2B_CreativeText = '. '; this.mid_Line2C_CreativeText = 'search.ebay.com/'; this.mid_Line3A_CreativeText = ''; this.mid_Line3B_CreativeText = ''; this.mid_Line3C_CreativeText = 'search.ebay.com/'; this.end_Line1A_CreativeText = '?'; this.end_Line1B_CreativeText = ''; this.end_Line1C_CreativeText = ''; this.end_Line2A_CreativeText = ''; this.end_Line2B_CreativeText = 'Shop now!'; this.end_Line2C_CreativeText = ''; this.end_Line3A_CreativeText = ''; this.end_Line3B_CreativeText = ''; this.end_Line3C_CreativeText = ''; this.countryId = '0'; this.width = 120; this.height = 600; this.imgWidth = '80'; this.imgHeight = '80'; this.itemCount = 2; this.titleCount = 46; this.catSize = 14; this.catCount = 2; this.kwSize=36; // item list this.itemList = new Array(); this.itemList[this.itemList.length] = new AdsItem('http://thumbs.ebaystatic.com/pict/260509763162',80,80,'http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fcgi.ebay.com%2Fws%2FeBayISAPI.dll%3FViewItem%26item%3D260509763162%26ih%3D016%26category%3D6726%26ast%3De%26rd%3D1%26keyword%3Datv%26cacat%3D66466','300cc ATV sport quad','Current Bid','$1,200.00','57 minutes','0',2); this.itemList[this.itemList.length] = new AdsItem('http://thumbs.ebaystatic.com/pict/370281554336',80,80,'http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fcgi.ebay.com%2Fws%2FeBayISAPI.dll%3FViewItem%26item%3D370281554336%26ih%3D024%26category%3D43984%26ast%3De%26rd%3D1%26keyword%3Datv%26cacat%3D0','54" ATV Plow Kit KAWASAKI PRAIRIE MOTOALLIANCE USA','Price','$424.99','','-',2); // search for list this.searchForList = new Array(); this.searchForList[this.searchForList.length] = new AdsLink('http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fsearch.ebay.com%2Fsearch%2Fsearch.dll%3Fsatitle%3Datv%26sacat%3D66466%26ast%3Dd','atv'); this.searchForList[this.searchForList.length] = new AdsLink('http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fsearch.ebay.com%2Fsearch%2Fsearch.dll%3Fsatitle%3Dpolaris+ranger%26sacat%3D66466%26ast%3Dd','polaris ranger'); this.searchForList[this.searchForList.length] = new AdsLink('http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fsearch.ebay.com%2Fsearch%2Fsearch.dll%3Fsatitle%3Dyamaha+rhino%26sacat%3D66466%26ast%3Dd','yamaha rhino'); this.searchForList[this.searchForList.length] = new AdsLink('http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fsearch.ebay.com%2Fsearch%2Fsearch.dll%3Fsatitle%3Dsnowmobile%26sacat%3D66466%26ast%3Dd','snowmobile'); this.searchForList[this.searchForList.length] = new AdsLink('http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fsearch.ebay.com%2Fsearch%2Fsearch.dll%3Fsatitle%3Dpolaris+rzr%26sacat%3D66466%26ast%3Dd','polaris rzr'); this.searchForList[this.searchForList.length] = new AdsLink('http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fsearch.ebay.com%2Fsearch%2Fsearch.dll%3Fsatitle%3Dpolaris%26sacat%3D66466%26ast%3Dd','polaris'); this.searchForList[this.searchForList.length] = new AdsLink('http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fsearch.ebay.com%2Fsearch%2Fsearch.dll%3Fsatitle%3Dutv%26sacat%3D66466%26ast%3Dd','utv'); this.searchForList[this.searchForList.length] = new AdsLink('http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fsearch.ebay.com%2Fsearch%2Fsearch.dll%3Fsatitle%3Dyamaha%26sacat%3D66466%26ast%3Dd','yamaha'); this.searchForList[this.searchForList.length] = new AdsLink('http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fsearch.ebay.com%2Fsearch%2Fsearch.dll%3Fsatitle%3Drhino%26sacat%3D66466%26ast%3Dd','rhino'); this.searchForList[this.searchForList.length] = new AdsLink('http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fsearch.ebay.com%2Fsearch%2Fsearch.dll%3Fsatitle%3Dbanshee%26sacat%3D66466%26ast%3Dd','banshee'); this.searchForList[this.searchForList.length] = new AdsLink('http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Fsearch.ebay.com%2Fsearch%2Fsearch.dll%3Fsatitle%3Dipod%26sacat%3D66466%26ast%3Dd','ipod'); // shop at list this.shopAtList = new Array(); this.shopAtList[this.shopAtList.length] = new AdsLink('http://rover.ebay.com/rover/1/711-37018-15584-0/1?loc=http%3A%2F%2Flistings.ebay.com%2Faw%2Fplistings%2Flist%2Fall%2Fcategory66466%2Findex.html','Powersports'); this.genImage = function(pImgType,pImgSrc, pImgSize) { var str = ""; if (!pImgSize) pImgSize='80'; if (pImgType == 2 || pImgType == 1) { if (pImgSize != '80') str += ''; else str += ''; } else { // display spacer image str += ''; } return str; } this.genLink = function(pLink, pText) { var op = ''; if (pLink.length > 0) op = ''+pText+''; else op = pText; return op; } this.genStripe = function(pHeight) { return this.stripeMulti?this.genStripeMulti(pHeight):this.genStripeSingle(pHeight); } this.genStripeMulti = function(pHeight) { var op = '
'; op += ''; op += ''; op += ''; op += ''; op += ''; op += ''; op += ''; op += ''; op += '
'; return op; } this.genStripeSingle = function(pHeight) { var op = '
'; op += ''; op += '
'; return op; } this.writeAd = function() { document.write(this.genPreviewTitle()); document.write(this.genAd()); document.write(this.genSniplet()); } this.genPreviewTitle = function() { var op = ""; return op; } this.genSniplet = function() { var op = ""; op += ''; return op; } this.getTitle = function(pTitle) { var charCount = 20; var lineCount = 1; if (pTitle.length>charCount) { var p = '...'; pTitle = pTitle.substring(0, charCount*lineCount-p.length-1); var r = '',line=1; for (var i = 0;i < pTitle.length;i++) { r += pTitle.charAt(i); if ((i+1) % charCount == 0) { r += '
'; line ++; } } r += line>=lineCount?'...':''; return r; } else return pTitle; } this.genAd = function() { var op ='
'; op += '
'; op += '
'; op += ''; op += '
'; op += ''; op += '
'; // items for (var i = 0;i < this.itemCount;i ++) { var item = this.itemList[i]; if (item) op += this.genItem(item.imgSrc, this.imgWidth, this.imgHeight, item.itemLink, item.itemTitle, item.priceTitle, item.price, item.timeLeft, item.imgType); else op += '
'; } // op += this.genSearchFor(); op += this.genShopAt(); // op += '
'; op += '
'; op += this.genSearchBox(); op += '
'; op += '
'; op += '
'+this.genLink(this.VMLink, this.logoText)+'
'; op += '
'; op += '
'; op += this.stripeMulti?this.genStripeMulti(6):this.genStripeSingle(6); op += '
'; op += '
'; return op; } this.genItem = function(pImgSrc, pImgW, pImgH, pItemLink, pItemTitle, pPriceTitle, pPrice, pTimeLeft, pImgType) { var op = '
'; op += '
'; op += '
'; op += '
'; op += ''+this.genImage(pImgType, pImgSrc, this.imgWidth)+''; op += '
'; op += '
'; op += '
'; op += '
'; op += ''+getTitle(pItemTitle, this.titleCount)+''; op += '
'; op += '
'+pPriceTitle+' '+pPrice+'
'; op += '
'+pTimeLeft+'
'; op += '
'; op += '
'; return op; } this.genSearchFor = function() { var op = ''; if (this.shopAtList.length < 1) { op += '
'; op += '
'; }else { op += '
'; op += '
'; } op += '
'+this.searchForText+'
'; op += '
'; var pre = ''; var cc = 0; var realSize=this.kwSize; if (this.shopAtList.length < 1) realSize=this.kwSize*2; for (var i=0;i 0) { op += pre+''+getTitle(link.text, link.text.length-tc)+''; break; } else { cc += 1+link.text.length; op += pre+''+link.text+''; } pre = this.sepCharacter; } op += '
'; return op; } this.genShopAt = function() { var op = ''; if (this.shopAtList.length > 0) { op += '
'; op += '
'; op += '
'+this.shopAtText+'
'; op += '
'; var pre = ''; for (var i=0;i= this.catCount) break; op += pre+''+getTitle(link.text,this.catSize)+''; pre = '
'; } op += '
'; } return op; } this.genSearchBox = function() { var op = ''; op += ''; op += ''; op += ''; op += ''; op += ''; op += ''; op += ''; op += '
   
'; return op; } } adSource = new AdsImageText120_600(); adSource.writeAd();