/* tdfk JS Library new*/ var dcmt = document; var order = 'hensa_desc'; var tdfkselect = ''; var imgs = new Array(); var lang = ''; function swpimg(elm,imgid,key,key2){ elm.src = imgs[imgid][key][key2].src } function swpimgFirstChild(elm,imgid,key,key2){ elm.firstElementChild.src = imgs[imgid][key][key2].src } function utilHttpRequest() { var XMLhttpObject = null; try{ XMLhttpObject = new XMLHttpRequest(); //firefox ie7,8 safai opera } catch(e) { try { XMLhttpObject = new ActiveXObject("Msxml2.XMLHTTP");// ie6 } catch(e) { try { XMLhttpObject = new ActiveXObject("Microsoft.XMLHTTP");// ie5.5 } catch(e){ return null; } } } return XMLhttpObject; } function dataSend(d_func,d_args){ // sending var poststr; poststr = 'func=' + d_func; for (var i in d_args){ poststr += '&' + i + '=' + encodeURIComponent(d_args[i]) } request = utilHttpRequest(); request.open("POST",'/com_ajax.php'); request.setRequestHeader("content-type","application/x-www-form-urlencoded;charset=UTF-8"); request.send(poststr); // receiving if(window.opera || window.safari || window.mozes){ request.onload = function () { dataReceive(d_func,request); } } else { request.onreadystatechange = function (){ if(request.readyState == 4) { dataReceive(d_func,request); } } } } function dataReceive(func,request) { if(func == 'tdfkranking') { var text = request.responseText; dcmt.getElementById('kiji_table_tdfk').innerHTML = text; } } function load() { } function utilDispTdfk(){ var func = 'tdfkranking'; var args = new Array(); args["tdfk_e"] = tdfkselect; args["lang"] = lang; var inputs = dcmt.getElementsByName('tdfkchk'); for (var k = 0 ; k < inputs.length ;k++ ) { if(inputs[k].checked == true){ args["categ_"+k] = inputs[k].value; } } var inputs = dcmt.getElementsByName('tdfkchkunit'); for (var k = 0 ; k < inputs.length ;k++ ) { if(inputs[k].checked == true){ args["unit_"+k] = inputs[k].value; } } args["order"] = order; dataSend(func,args); } var tdfkselected = "hokkaido"; function utilPartsSelect(){ ken_e = dcmt.getElementById("tdfkpartsname").value; tdfktag = dcmt.getElementById("tdfkpartstag").value; tdfktag = tdfktag.split(tdfkselected); tdfktag = tdfktag.join(ken_e); tdfkselected = ken_e; document.getElementById("tdfkpartstag").value = tdfktag; } function utilDispTable(key) { order = key; utilDispTdfk(); } function utilDispKijiTable(key) { if(dcmt.getElementById("t_soukan")){ dcmt.getElementById("t_soukan").style.display = 'none'; } if(dcmt.getElementById("t_soukan_r")){ dcmt.getElementById("t_soukan_r").style.display = 'none'; } dcmt.getElementById("t_"+key).style.display = ''; } function utilKijiTable(key,order,type,lang){ style1 = style2 = style3 = style4 = style5 = style6 = style7 = style8 = '' if(key=='tdfk'){ if(lang == "jp" || lang == "sfjp"){ tdfk_order_tmp = tdfk_order_tdfk } else { tdfk_order_tmp = tdfk_order_abc } rankkey = 'rankhensa'; if(order=='r'){ style2 = " style=\"background:#666666;color:#FFFFFF;\" "; } else { style1 = " style=\"background:#666666;color:#FFFFFF;\" "; } } else if(key=='jissu') { tdfk_order_tmp = tdfk_order_jissu rankkey = 'rankjissu'; if(order=='r'){ style4 = " style=\"background:#666666;color:#FFFFFF;\" "; } else { style3 = " style=\"background:#666666;color:#FFFFFF;\" "; } } else if(key=='per') { tdfk_order_tmp = tdfk_order_hensachi rankkey = 'rankhensa'; if(order=='r'){ style6 = " style=\"background:#666666;color:#FFFFFF;\" "; } else { style5 = " style=\"background:#666666;color:#FFFFFF;\" "; } } else if(key=='hensachi') { tdfk_order_tmp = tdfk_order_hensachi rankkey = 'rankhensa'; if(order=='r'){ style8 = " style=\"background:#666666;color:#FFFFFF;\" "; } else { style7 = " style=\"background:#666666;color:#FFFFFF;\" "; } } tdfk_order = new Array(); for(var j=0;j"; ttag += ""; ttag += ""+tn+"  "; ttag += ""+ts+""; if(type=="double"){ ttag += ""; ttag += ""+td+"  "; ttag += ""+ta+""; } ttag += ""; ttag += ""+td+"  "; ttag += ""+ta+""; ttag += ""; ttag += ""+td+"  "; ttag += ""+ta+""; ttag += ""; ttag2 = '' for (var i=0; i"; } if(lang == "jp"){ tttemp += ""; } else if(lang == "sfjp"){ tttemp += ""; } else if(lang == "en"){ tttemp += ""; } if(lang == "jp" || lang == "sfjp"){ tttemp += kinfo['name']; } else { tttemp += kinfo['namee']; } tttemp += ""; tttemp += ""; if(kinfo['newjissunum']){ tttemp += kinfo['newjissunum']; tttemp += tdfk_kjinfo['unit2']; } else { tttemp += kinfo['jissunum']; if(lang=='jp' || lang == "sfjp"){ tttemp += tdfk_kjinfo['unit']; } else if (lang='en') { tttemp += " "+tdfk_kjinfo['e_unit']; } } tttemp += ""; if(type=="double"){ tttemp += ""+kinfo['pernum']; if(lang=='jp' || lang == "sfjp"){ tttemp += tdfk_kjinfo['unit']; } else if (lang='en') { tttemp += " "+tdfk_kjinfo['e_unit']; } tttemp += ""; } tttemp += ""+kinfo['hensachinum']+""; tttemp += ""; if(((key=='jissu') || (key=='per') || (key=='hensachi')) && kinfo['jissunum'] == '--'){ ttag2 += tttemp; } else { ttag += tttemp; } } ttag += ttag2; kinfo = tdfk_data['zenkoku']; ttag += ""; ttag += ""; if(lang == "jp" || lang == "sfjp"){ ttag += ""+kinfo['name']+""; } else { ttag += "Average"; } ttag += ""; if(kinfo['newjissunum']){ ttag += kinfo['newjissunum']; ttag += tdfk_kjinfo['unit2']; } else { ttag += kinfo['jissunum']; if(lang=='jp' || lang == "sfjp"){ ttag += tdfk_kjinfo['unit']; } else if (lang='en') { ttag += " "+tdfk_kjinfo['e_unit']; } } ttag += ""; if(type=="double"){ ttag += ""+kinfo['pernum']; if(lang=='jp' || lang == "sfjp"){ ttag += tdfk_kjinfo['unit']; } else if (lang='en') { ttag += " "+tdfk_kjinfo['e_unit']; } ttag += ""; } ttag += ""; ttag += ""; ttag += tdfk_kjinfo['foot']; ttag += ""; document.getElementById("kiji_table_swap").innerHTML = ttag; } function utilDispCheck(mode) { var inputs = dcmt.getElementsByName('tdfkchk'); for (var k = 0 ; k < inputs.length ;k++ ) { if(mode == 'show'){ inputs[k].checked = true; } else { inputs[k].checked = false; } } var inputs = dcmt.getElementsByName('tdfkchkunit'); for (var k = 0 ; k < inputs.length ;k++ ) { if(mode == 'show'){ inputs[k].checked = true; } else { inputs[k].checked = false; } } utilDispTdfk(); } function utilDispRanking(key) { dcmt.getElementById('rank_d').style.display = "none"; dcmt.getElementById('rank_w').style.display = "none"; dcmt.getElementById('rank_m').style.display = "none"; dcmt.getElementById('rank_'+key).style.display = ""; } function utilWinOpen(id) { if( dcmt.getElementById(id).style.display == "none"){ dcmt.getElementById(id).style.display = ""; } else { dcmt.getElementById(id).style.display = "none"; } } function utilShowMapInfo(id){ dcmt.getElementById("mapinfo").innerHTML = id; } function z(l) { l=unescape(l); var m=""; for(var i=0;i