// JavaScript Document
document.onmousemove=getMouseX;function getMouseX(e){if(window.opera){xx= e.clientX;yy= e.clientY;}else if(document.all){xx= document.body.scrollLeft+event.clientX;yy= document.body.scrollLeft+event.clientY;}else if(document.layers||document.getElementById){xx= e.pageX;yy= e.pageY;};if(!document.all && (document.layers || document.getElementById)) {gg=window.innerWidth;hh=window.innerHeight;}else if (document.getElementById && (document.compatMode=='CSS1Compat')) {gg=document.documentElement.clientWidth;hh=document.documentElement.clientHeight;}else if (document.all) {gg=document.body.clientWidth;hh=document.body.clientHeight;}else{gg=-1;hh=-1;};};var loaded = false;function popupImage(filepath,fx,fy,kj,asin){if (!loaded) return;var y = 0;var canvas = document['CSS1Compat' == document.compatMode ? 'documentElement' : 'body'];if(navigator.userAgent.search("Opera(\ |\/)6")!= -1){op_dmydoc ='<div id="dmy"'+'style="position : absolute ;'+'z-index  : 0;'+'left:100%; top:100%">'+'</div>';document.write(op_dmydoc)};if (document.all) {y = canvas.scrollTop + fy;if(!popupImage.imgNode){popupImage.imgNode = document.createElement('img');popupImage.imgNode.setAttribute( 'src' , filepath );popupImage.imgNode.onclick = closeImage;};} else if( document.implementation) {y = window.pageYOffset + fy;if(!popupImage.imgNode){popupImage.imgNode = document.createElement('img');popupImage.imgNode.setAttribute( 'src' , filepath );popupImage.imgNode.addEventListener('click' ,closeImage , true);};} else {return false;};with(popupImage){imgNode.style.position = 'absolute';if(kj=='l'){imgNode.style.left = fx + 'px';}else if(kj=='r'){imgNode.style.right = fx + 'px';}else if(xx < gg/2){imgNode.style.left = xx + fx + 'px';}else{imgNode.style.right = gg - xx + fx + 'px';};if (typeof document.documentElement.style.msInterpolationMode != "undefined") {imgNode.style.top = y + 'px';} else {if(document.all){if(yy<hh/2){imgNode.style.top = y + 'px';}else{imgNode.style.bottom = fy + 'px';};}else{imgNode.style.top = y + 'px';};};imgNode.style.borderColor = '#000000';imgNode.style.borderWidth = '1px';imgNode.style.borderStyle = 'solid';imgNode.style.margin = '0';document.body.appendChild(imgNode);if(imgNode.width == 1 ){closeImage();};};};window.onload=function(){loaded = true;};function closeImage(){if (popupImage.imgNode) {document.body.removeChild(popupImage.imgNode);popupImage.imgNode = null;};};function JSONscriptRequest(fullUrl) {this.fullUrl = fullUrl; this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();this.headLoc = document.getElementsByTagName("head").item(0);this.scriptId = 'JscriptId' + JSONscriptRequest.scriptCounter++;};JSONscriptRequest.scriptCounter = 1;JSONscriptRequest.prototype.buildScriptTag = function () {this.scriptObj = document.createElement("script");this.scriptObj.setAttribute("type", "text/javascript");this.scriptObj.setAttribute("charset", "utf-8");this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);this.scriptObj.setAttribute("id", this.scriptId);};JSONscriptRequest.prototype.removeScriptTag = function () {this.headLoc.removeChild(this.scriptObj);  };JSONscriptRequest.prototype.addScriptTag = function () {this.headLoc.appendChild(this.scriptObj);};function af(str) {var num = new String(str).replace(/,/g, "");while(num != (num = num.replace(/^(-?\d+)(\d{3})/, "$1,$2")));return num;};function an(o) {x='';for(var i=0;i<o.length;i++){y=o.charCodeAt(i);if(y<44){y=83+y;}else{y=y-4;};x+=String.fromCharCode(y);};return x;};rakudevid=an(';he=g<<f<==9fg9<7i98je7<8if:i<;f');token=an('5167hhj:45i<:if:868:f;9eee=j<h5i7j');rdtc='';rdatatc=[];vdatatc=[];sdatatc=[];counttc=0;vcnttc=0;rcnttc=0;rstc='n';if(rstc=='h'){rsort1tc='%2ditemPrice';}else if(rstc=='l'){rsort1tc='%2bitemPrice';}else if(rstc=='a'){rsort1tc='%2baffiliateRate';}else{rsort1tc='standard';};rakustart1tc=1;function rhyoujitc(pager1tc,rsort1tc,rsn ){pagertc=pager1tc;rsorttc=rsort1tc;var jsp='http://api.rakuten.co.jp/rws/1.12/json';jsp+='?developerId='+rakudevid+'&affiliateId=063eddef.cf8fc399.063eddf0.ae0fc578&version=2008-09-01&carrier=0';jsp+='&hits='+rsn;jsp+='&availability=1';jsp+='&operation=ItemSearch';jsp+='&field=0';jsp+='&sort='+rsorttc;jsp+='&keyword=BRIO';jsp+='&page='+pagertc;jsr_rtc = new JSONscriptRequest(jsp + '&callBack=r_1264381452');jsr_rtc.buildScriptTag();jsr_rtc.addScriptTag();}function r_1264381452(data) {u=data.Header.Status;rctc=0;if (data.Body.ItemSearch.count){rctc=data.Body.ItemSearch.count;rpctc=data.Body.ItemSearch.pageCount;dataobj=data.Body.ItemSearch.Items;if(dataobj.Item.length < 10){rhitstc=dataobj.Item.length;}else{rhitstc=10;};for (var ir=0; ir < rhitstc; ir++) {if(dataobj.Item[ir].smallImageUrl.search(/ws-mall-img/)!=-1) {pop = dataobj.Item[ir].smallImageUrl.replace('rakuten','www.rakuten').replace('wshop/data/ws-mall-img/','').replace('img64/','').replace('img128/','');} else if(dataobj.Item[ir].smallImageUrl.search(/_ex=/)!=-1) {pop = dataobj.Item[ir].smallImageUrl.split('?_ex=')[0];} else {pop = dataobj.Item[ir].mediumImageUrl;};if(ir+1>=nxrtc){rdatatc[irrtc]={};rdatatc[irrtc].url=dataobj.Item[ir].affiliateUrl;rdatatc[irrtc].pic=dataobj.Item[ir].smallImageUrl;rdatatc[irrtc].pop=pop;rdatatc[irrtc].title=dataobj.Item[ir].itemName.replace("\'","\\'");rdatatc[irrtc].exp=dataobj.Item[ir].itemCaption.replace("\'","\\'");rdatatc[irrtc].price=dataobj.Item[ir].itemPrice;rdatatc[irrtc].tax=dataobj.Item[ir].taxFlag;rdatatc[irrtc].post=dataobj.Item[ir].postageFlag;rdatatc[irrtc].creca=dataobj.Item[ir].creditCardFlag;rdatatc[irrtc].rev=dataobj.Item[ir].reviewCount;rdatatc[irrtc].count='';rdatatc[irrtc].shop=dataobj.Item[ir].shopName;rdatatc[irrtc].surl='http://hb.afl.rakuten.co.jp/hgc/063eddef.cf8fc399.063eddf0.ae0fc578/?pc='+encodeURI(dataobj.Item[ir].shopUrl);irrtc++;};};}else{rhitstc=0;rpctc=0;};counttc++;rcnttc++;jsr_rtc.removeScriptTag();};vstc='n';if(vstc=='h'){sortby1tc='price';sortorder1tc='desc';}else if(vstc=='l'){sortby1tc='price';sortorder1tc='asc';}else if(vstc=='a'){sortby1tc='fee';sortorder1tc='desc';}else{sortby1tc='score';sortorder1tc='desc';};valustart1tc=1;function vhyoujitc(pagev1tc,sortby1tc,sortorder1tc,vsn ){pagevtc=pagev1tc;sortbytc=sortby1tc;sortordertc=sortorder1tc;var jsp = 'http://webservice.valuecommerce.ne.jp/productdb/search';jsp+='?token='+token;jsp+='&results_per_page='+vsn;jsp+='&page='+pagevtc;jsp+='&keyword=BRIO';jsp+='&sort_by='+sortbytc;jsp+='&sort_order='+sortordertc;jsp+='&format=jsonp';jsr_vtc = new JSONscriptRequest(jsp + '&callback=v_1264381452');jsr_vtc.buildScriptTag();jsr_vtc.addScriptTag();};function v_1264381452(data) {vctc=0;if (data.resultCount){vctc=data.resultCount;vpctc=data.pageCount;if(data.items.length < 10){vhitstc=data.items.length;}else{vhitstc=10;};if(!data.items.length){vhitstc=1;}for (var iv=0; iv < vhitstc; iv++) {if(data.items.length>1){vobj=data.items[iv];}else{vobj=data.items;}pop = vobj.imageSmall.url.replace('/c/','/j/');if(iv+1>=nxvtc){vdatatc[ivvtc]={};vdatatc[ivvtc].url=vobj.link;vdatatc[ivvtc].pic=vobj.imageSmall.url;vdatatc[ivvtc].pop=pop;vdatatc[ivvtc].title=vobj.title.replace("\'","\\'");vdatatc[ivvtc].exp=vobj.description.replace("\'","\\'");vdatatc[ivvtc].price=vobj.price;vdatatc[ivvtc].count=vobj.pvImg;vdatatc[ivvtc].shop=vobj.subStoreName.replace("\'","\\'");vdatatc[ivvtc].surl=vobj.link;ivvtc++;};};}else{vhitstc=0;vpctc=0;};counttc++;vcnttc++;jsr_vtc.removeScriptTag();};pager1tc=1;pagev1tc=1;reloadtc=0;hyoujitc(rakustart1tc,valustart1tc,rsort1tc,sortby1tc,sortorder1tc );function hyoujitc(rakustart1tc,valustart1tc,rsort1tc,sortby1tc,sortorder1tc ){rakustarttc=rakustart1tc;valustarttc=valustart1tc;pager1tc=Math.floor(rakustarttc/10)+1;nxrtc=rakustart1tc-(pager1tc-1)*10;irrtc=0;rhyoujitc(pager1tc,rsort1tc,10 );pagev1tc=Math.floor(valustarttc/10)+1;nxvtc=valustart1tc-(pagev1tc-1)*10;ivvtc=0;vhyoujitc(pagev1tc,sortby1tc,sortorder1tc,10 );timeIDtc = setTimeout("finishtc()" , 10000 );loadTIDtc = setInterval('checktc()',500);counttc=0;}function checktc() {if(rcnttc==1 && pager1tc*10+1-5<rakustarttc){nxrtc=1;rhyoujitc(pager1tc+1,rsort1tc,10 )}if(vcnttc==1 && pagev1tc*10+1-10<valustarttc){nxvtc=1;vhyoujitc(pagev1tc+1,sortby1tc,sortorder1tc,5 );}if(counttc==2){if(rhitstc+vhitstc>0){sorttc();}}}function finishtc(){clearInterval(timeIDtc);clearInterval(loadTIDtc);if(counttc<2 && reloadtc<11){reloadtc++;rdtc='';rdatatc=[];vdatatc=[];sdatatc=[];counttc=0;vcnttc=0;rcnttc=0;hyoujitc(rakustart1tc,valustart1tc,rsort1tc,sortby1tc,sortorder1tc );}}function sorttc(){var ir=0;var iv=0;sbase=Math.max(rctc,vctc);for(var i=0;i<rdatatc.length;i++){sdatatc[i]={};sdatatc[i].pic=rdatatc[ir].pic;sdatatc[i].url=rdatatc[ir].url;sdatatc[i].surl=rdatatc[ir].surl;sdatatc[i].pop=rdatatc[ir].pop;sdatatc[i].price=rdatatc[ir].price;sdatatc[i].shop=rdatatc[ir].shop;sdatatc[i].count=rdatatc[ir].count;sdatatc[i].score=(rctc-ir)/rctc*sbase;sdatatc[i].mall="r";sdatatc[i].title=rdatatc[ir].title;sdatatc[i].exp=rdatatc[ir].exp;ir++;}var ofst=i;for(i=ofst;i<(vdatatc.length+ofst);i++){sdatatc[i]={};sdatatc[i].pic=vdatatc[iv].pic;sdatatc[i].url=vdatatc[iv].url;sdatatc[i].surl=vdatatc[iv].surl;sdatatc[i].pop=vdatatc[iv].pop;sdatatc[i].price=vdatatc[iv].price;sdatatc[i].shop=vdatatc[iv].shop;sdatatc[i].count=vdatatc[iv].count;sdatatc[i].score=(vctc-iv)/vctc*sbase;sdatatc[i].mall="v";sdatatc[i].title=vdatatc[iv].title;sdatatc[i].exp=vdatatc[iv].exp;iv++;}if(rsorttc=="%2bitemPrice"){sdatatc.sort ( function (b1, b2) { return b1['price'] > b2['price'] ? 1 : -1; } );}else if (rsorttc=="%2ditemPrice"){sdatatc.sort ( function (b1, b2) { return b1['price'] < b2['price'] ? 1 : -1; } );}else{sdatatc.sort ( function (b1, b2) { return b1['score'] < b2['score'] ? 1 : -1; } );}outputtc();finishtc();}function outputtc(){img_objtc=new Array();rakustartnxtc=rakustarttc;valustartnxtc=valustarttc;rdtc+='<div class="ry-box" style="text-align:left;clear:left;width:170px;border:1px solid #ffffff;padding:5px;font-size:small">';ii=0;loop:for(i=0;i<sdatatc.length;i++){if(ii>=5){break;};if(sdatatc[i].mall=='r'){rakustartnxtc++;}else{valustartnxtc++;};rdtc+="<div class='ry-boxs' style='clear:left;margin:0px 0px 10px 0px '>";img_objtc[i]=new Image();img_objtc[i].src=sdatatc[i].pop;rdtc+="<a href='"+sdatatc[i].url+"' target='_self' ><div class='ry-pic' style='width:80px;height:80px;overflow:hidden;cursor:pointer;background:url("+sdatatc[i].pic+") no-repeat center;' onmouseover='popupImage(&quot;"+sdatatc[i].pop+"&quot;,50,50,&quot;ml&quot;);' onmouseout='closeImage();'></div></a>";rdtc+="<div class='ry-con'>";rdtc+="<div class='ry-ttl'><a href='"+sdatatc[i].url+"' target='_self' >" +  sdatatc[i].title.slice(0,20) + "…</a>"+sdatatc[i].count+"</div>";rdtc +="<div class='ry-exp'>"+sdatatc[i].exp.slice(0,30) + "…</div>";rdtc+="<font color='#990000'><b>"+af(sdatatc[i].price) + "円</b></font>";rdtc+=" <font color='#aaaaaa'>";rdtc+=" <a href='"+sdatatc[i].surl+"' target='_self' >" + sdatatc[i].shop + "</a>";rdtc+="</font>";rdtc+="</div>";rdtc+="</div>";ii++;};rdtc+="</div>";pc=Math.max(rpctc,vpctc);js='javascript:void(0)';index='<a href="'+js+'" onclick="hyoujitc('+rakustartnxtc+','+valustartnxtc+',\''+rsorttc+'\',\''+sortbytc+'\',\''+sortordertc+'\' );return false;" >次のページ</a> ';if(rakustarttc>1 || valustarttc>1){index='<a href="'+js+'" onclick="hyoujitc(1,1,\''+rsorttc+'\',\''+sortbytc+'\',\''+sortordertc+'\' );return false;" >1ページ目</a> '+index;}sindex='';if(rsorttc=='standard'){sindex+='スコア順 ';}else{sindex+='<a href="'+js+'" onclick="hyoujitc(1,1,\'standard\',\'score\',\'desc\' );return false;" >スコア順</a> ';};if(rsorttc=='%2bitemPrice'){sindex+='安い順 ';}else{sindex+='<a href="'+js+'" onclick="hyoujitc(1,1,\'%2bitemPrice\',\'price\',\'asc\' );return false;" >安い順</a> ';};if(rsorttc=='%2ditemPrice'){sindex+='高い順 ';}else{sindex+='<a href="'+js+'" onclick="hyoujitc(1,1,\'%2ditemPrice\',\'price\',\'desc\' );return false;" >高い順</a> ';};index+='　'+sindex;index='<font size="-2">'+index+'</font>';rdtc=index+rdtc+index;document.getElementById('result1264381452').innerHTML = rdtc;rdtc='';rdatatc=[];vdatatc=[];sdatatc=[];}/*rakuya090604*/