if (typeof be == 'undefined'){ var be = {}; } if (typeof be.ebay == 'undefined'){ be.ebay = {}; } if (typeof be.ebay.srtm == 'undefined'){ be.ebay.srtm = {}; } be.ebay.srtm.modify = function() { var itemID = null; var rtmContainer = 'rtm_div_306'; var populateScript = 'http://smartrtm.ebay.be/srtm/user/populate.php'; var placementContainerID = []; var placementWidth = []; var placementHeight = []; placementContainerID.push("UNDER_BUY_SAFELY"); placementWidth.push(300); placementHeight.push(250); placementContainerID.push("UNDER_PRICE"); placementWidth.push(200); placementHeight.push(20); var bannerType = '1012576'; var siteId = 23; function getItemID() { try{ var loc = document.location.href; var matches = loc.match(/[Q&?]item[=Z](\d+)/); if (typeof matches[1] != "undefined"){ itemID = matches[1]; } } catch(e){ //Can't get the itemID } } function addIframe(){ try{ // if we found it // get the rtm placeholder element var placement = document.getElementById(rtmContainer); var iFrameAdded = false; // if we found it if(placement){ // we create a new div var pMax = placementContainerID.length; for (var p = 0; p < pMax; p++){ var par = placement.parentNode; var newplacement = document.createElement('DIV'); if(newplacement){ newplacement.style.height = placementHeight[p]+"px"; newplacement.style.width = placementWidth[p]+"px"; newplacement.id = placementContainerID[p]; newplacement.style.display = "none"; // and we insert it in the tree /* function insertAfter(parent, node, referenceNode) { parent.insertBefore(node, referenceNode.nextSibling); } */ /* Search left table 'Veilig Kopen' */ switch(placementContainerID[p]){ case "UNDER_BUY_SAFELY": var tdList = document.getElementsByTagName("td"); var iMax = tdList.length; for (var i = 0; i < iMax; i++){ var tdElem = tdList[i]; if (tdElem.className == "sectiontitle" && tdElem.innerHTML.match(/(Veilig\skopen)|(Acheter en s.?curit.?)/) ){ var table = tdElem; while(table.tagName != "TABLE"){ table = table.parentNode; } par = table.parentNode; break; } } break;case "UNDER_PRICE": break; default: break; } if(par != null && par.appendChild(newplacement)){ placement.style.height = "1px"; if (!iFrameAdded){ // plus we create a new iframe that will take control of that placement // and serve the appropriate content for that item var newiframe = document.createElement('IFRAME'); if(newiframe){ newiframe.width = "1"; newiframe.height = "1"; newiframe.frameBorder = "0"; newiframe.style.visibility = "hidden"; newiframe.src = populateScript + "?itemID=0&bannerType="+bannerType+"&siteId="+siteId; if(!document.getElementsByTagName('body')[0].appendChild(newiframe)){ // do nothing } // end if DIV insertion failed } iFrameAdded = true; } } // end if DIV insertion succeeded } // end if DIV dom creation succeded } } } catch(e){ //Can't add the iframe } } function getComputedStyle(elem, style){ var computedStyle; if (typeof elem.currentStyle != 'undefined'){ computedStyle = elem.currentStyle; } else { computedStyle = document.defaultView.getComputedStyle(elem, null); } return computedStyle[style]; } function processInlineJavascript(){ } function init(){ getItemID(); if (itemID != null){ addIframe(); } else { //Can't found the itemID } processInlineJavascript(); } init(); }; if (!document.getElementById("glbfooter")){ try { // hook our function in the event handler to the "body onload" event var _d = vjo.dsf.EventDispatcher; _d.add('body','load', be.ebay.srtm.modify); } catch(e){} } else { be.ebay.srtm.modify(); }