var linkAry={'':''}; var LINK_MAX=0; var AF_ID=15051; fncCreateLink(linkAry); function fncCreateLink(strLinkSrc){ var intCount =0; var body = document.getElementById("ifr"); var divM = document.createElement('div'); divM.style.cssText='width:155px;padding:0px;margin:0px;border-style:solid;border-width:1px;border-color:#ffffff;font-size:12px;';var divT = document.createElement('div'); divT.style.cssText='width:100%;height:20px;background-color:#ffffff;color:#ffffff;padding:3px 0px 1px 0px;border-style:solid;border-width:0px 0px 1px 0px;border-color:#ffffff ;text-align:center;';var titleText = document.createTextNode('売れ筋一覧'); divT.appendChild(titleText); var divS = document.createElement('div'); divS.style.cssText='top:20px;height:-20px;overflow:auto;';var tbl = document.createElement('table'); tbl.style.cssText='width:100%;border-style:none;background-color:#ffffff;font-size:14px;'; var tblBody = document.createElement("tbody"); var row = document.createElement("tr"); var cell = document.createElement("td"); cell.style.cssText="padding:2px 0px 1px 0px;border-style:solid;border-width:0px;text-align:center;background-color:#ffffff;color:black;"; row.appendChild(cell); tblBody.appendChild(row); for (var i=1; i<=LINK_MAX; i++){ var row = document.createElement("tr"); var cell = document.createElement("td"); cell.style.cssText='padding:2px 0px 12px 4px;border-style:solid;border-color:#c9c9c9;border-width:0px 0px 2px 0px;'; var cellText = document.createTextNode((strLinkSrc[i].split("|"))[1]); var link = document.createElement("a"); link.setAttribute('target', '_blank'); link.style.cssText = 'color:#000000;'; addEventListener(link,'mouseover','window.status="' + (strLinkSrc[i].split("|"))[2] + '";return true'); addEventListener(link,'mouseout','fncClsWindowStat();'); var rankSpan = document.createElement("span"); rankSpan.style.cssText = "display:block; color:red;font-size:12px;"; var rankString = String(i) + "位"; var rankText = document.createTextNode(rankString); rankSpan.appendChild(rankText); cell.appendChild(rankSpan); var linkSrc = (strLinkSrc[i].split("|"))[0]; var img = document.createElement("img"); img.src="http://www.infotop.jp/" + linkSrc; img.style.cssText = "width:40px; height:40px; border-style:none;float:left;margin:0px 12px 12px 0px;"; link.appendChild(img); var itemCd = new String(linkSrc); with(itemCd){ itemCd=substring(indexOf("_")+1,indexOf(".")); } link.href = "http://www.infotop.jp/click.php?aid=" + AF_ID +"&iid="+itemCd; link.appendChild(cellText); cell.appendChild(link); row.appendChild(cell); tblBody.appendChild(row); } // add the row to the end of the table body // tblBody.appendChild(row); tbl.appendChild(tblBody); divS.appendChild(tbl); divM.appendChild(divT); // divM.appendChild(divAd); divM.appendChild(divS); body.appendChild(divM); // var pwby = document.createElement('a'); // pwby.setAttribute('target', '_blank'); // pwby.href = 'http://infotoplink.tree75.net/'; // pwby.style.cssText='font-size:10px'; // var pwbyText = document.createTextNode('このランキング設置しませんか?'); // pwby.appendChild(pwbyText); // body.appendChild(pwby); } function addEventListener(target, type, func) { if(target.attachEvent) { target.attachEvent("on" + type, new Function(func) ); } else if(target.addEventListener) { // target.addEventListener(type, func, true); } else { //イベントリスナが使えない場合は on○○ 属性を上書き target["on" + type] = func; } } function fncClsWindowStat(){ window.status=""; return true; }