
function _xGetElementsByClass(searchClass,targetTag){var classElements=new Array();var allElements=document.getElementsByTagName(targetTag);for(i=0,j=0;i<allElements.length;i++){if(allElements[i].className==searchClass){classElements[j]=allElements[i];j++;}}
return classElements;}
function _xGetElementsByAllClass(searchClass){if(document.all){var classElements=new Array();var allElements=document.all;for(i=0,j=0;i<allElements.length;i++){if(allElements[i].className==searchClass){classElements[j]=allElements[i];j++;}}}else if(document.getElementsByTagName){var classElements=new Array();var allElements=document.getElementsByTagName("*");for(i=0,j=0;i<allElements.length;i++){if(allElements[i].className==searchClass){classElements[j]=allElements[i];j++;}}}else{return;}
return classElements;}
function _xDisplay(id,type){if($(id))$(id).style.display=type;}
function _xRemoveAttribute(type,attr){if($(type))$(type).removeAttribute(attr);}
function _xSetAttribute(type,attr,value){if($(type))$(type).setAttribute(attr,value);}
function _xSetClass(id,classname){if($(id))$(id).className=classname;}
function _xGetHrefAttribute(type){if($(type)){var tmp=$(type).getAttribute('href',2);if(tmp!=null&&tmp.startsWith('http')){var num=tmp.indexOf('#');return tmp.substring(num);}else if(tmp!=null){return tmp;}else{return null;}}}
function _xz2h_digit(src){return src.replace(/([０-９，])/g,function($0){return String.fromCharCode($0.charCodeAt(0)-65248);});}
function _xh2z_alpha(src){return src.replace(/([A-Za-z])/g,function($0){return String.fromCharCode($0.charCodeAt(0)+65248);});}
function _xToKanji(arb,issen){var suuji="〇一二三四五六七八九";var keta="〇一十百千万十百千億十百千兆十百千";var knj="";var flag=false;var i,kt1,kt2,num;arb=_xz2h_digit(arb);arb=arb.replace(/,/g,"");if(arb.length<keta.length){for(i=0;i<arb.length;i++){num=parseInt(arb.charAt(i));kt1=arb.length-i;kt2=kt1%4;if(num>0&&(num>1||kt2==1||(issen&&kt2==0))){knj+=suuji.charAt(num);flag=true;}
if(kt1>1&&(num>0||kt2==1)){if(flag||num==1){knj+=keta.charAt(kt1);flag=true;}}
if(kt2==1)flag=false;}}else{window.alert("表現出来ない桁数です。:"+arb);knj=arb;}
if(knj.length==0)knj="零";return knj;}
function _xconv(wareki){var wareki_=wareki;var issen=document.tform.C1.checked;var reg=new RegExp(document.tform.T1.value,"g");var dest=wareki_.replace(reg,function($0){return _xToKanji($0,issen);});if(document.tform.C2.checked){return _xh2z_alpha(dest);}else{return dest;}}
function _xRepAll(str,rep_str,tgt_str){reg1=new RegExp(rep_str,"g");return str.replace(reg1,tgt_str);}
function _x_z2hconv(src,exc){var str=new String;var len=src.length;for(var i=0;i<len;i++){var c=src.charCodeAt(i);if(exc.indexOf(src.charAt(i))>-1){str+=src.charAt(i);}else if(c>=65281&&c<=65374&&c!=65340){str+=String.fromCharCode(c-65248);}else if(c==8217){str+=String.fromCharCode(39);}else if(c==8221){str+=String.fromCharCode(34);}else if(c==12288){str+=String.fromCharCode(32);}else if(c==65507){str+=String.fromCharCode(126);}else if(c==65509){str+=String.fromCharCode(92);}else{str+=src.charAt(i);}}
return str;}
function _xconvertZtoH(src,exc){return _x_z2hconv(src,exc);}
function _xdelspace(str,flg,match){var tmp_str=str;var str_len=tmp_str.length;if(flg=='top'){while(tmp_str.search(match)==0){tmp_str=tmp_str.substr(1);}}else if(flg=='last'){while(tmp_str.charAt(str_len-1)==match){tmp_str=tmp_str.substr(0,str_len-1);str_len=tmp_str.length;}}
return tmp_str;}
function _xRegConvUNDERBAR(str,match){var tmp_str=str;if(tmp_str.search("_{2,}")){tmp_str=_xRepAll(tmp_str,'_{2,}',match);}
tmp_str=_xdelspace(tmp_str,'top',match);tmp_str=_xdelspace(tmp_str,'last',match);return tmp_str;}
function _xRegConvSpace(str,match){var tmp_str=str;if(tmp_str.search(" {2,}")){tmp_str=_xRepAll(tmp_str,' {2,}',match);}
tmp_str=_xdelspace(tmp_str,'top',match);tmp_str=_xdelspace(tmp_str,'last',match);return tmp_str;}
function _xGetCookie(name){var cname=name+"=";var i=0;while(i<document.cookie.length)
{var j=i+cname.length;if(document.cookie.substring(i,j)==cname)
{var leng=document.cookie.indexOf(";",j);if(leng==-1)
leng=document.cookie.length;return unescape(document.cookie.substring(j,leng));}
i=document.cookie.indexOf(" ",i)+1;if(i==0)break;}
return null;}
function _xMatchArray(str){var tmp=str;var xtmp=tmp.match(/\"[^\"]*\"/g);return xtmp;}
function _xInsertMess(id,mess){$(id).innerHTML=mess;}
function _xFormCheck(inForm){var str="";for(i=0;i<document.forms[inForm].elements.length;i++){var xele=document.forms[inForm].elements[i];str=str+"NAME : "+xele.name+"    VALUE : "+xele.value+"\n";}
alert(str);}
function _xGetParamCheck(inForm){var str="?";for(i=0;i<document.forms[inForm].elements.length;i++){var xele=document.forms[inForm].elements[i];if(i==document.forms[inForm].elements.length-1){str=str+xele.name+"="+xele.value;}else{str=str+xele.name+"="+xele.value+"&";}}
alert(str);}
function _xGetWindowHeight(){if(Prototype.Browser.IE){return document.body.clientHeight;}else{return innerHeight;}}
function _xGetWindowWidth(){if(Prototype.Browser.IE){return document.body.clientWidth;}else{return innerWidth;}}
function _xAddQuery(inForm,inType,inName,inValue){_form=document.forms[inForm];query=document.createElement("input");query.type=inType;query.name=inName;query.value=inValue;_form.appendChild(query);}
function _xGetForm(inForm){if($('fom')){return $('fom');}else{return document.forms[inForm];}}
function _xConvMonth(month_num){if(month_num=="0")return"Jan";if(month_num=="1")return"Feb";if(month_num=="2")return"Mar";if(month_num=="3")return"Apr";if(month_num=="4")return"May";if(month_num=="5")return"Jun";if(month_num=="6")return"Jul";if(month_num=="7")return"Aug";if(month_num=="8")return"Sep";if(month_num=="9")return"Oct";if(month_num=="10")return"Nov";if(month_num=="11")return"Dec";}
function _xConvDate(date,type){var convdate;var tmp_month;var tmp_day;split_date=date.split("/");if(type=="start"){if(split_date[1]==null||split_date[1]==""){tmp_month="01";}else{if(split_date[1].length=="1"){tmp_month="0"+split_date[1];}else{tmp_month=split_date[1];}}
if(split_date[2]==null||split_date[2]==""){tmp_day="01";}else{if(split_date[2].length=="1"){tmp_day="0"+split_date[2];}else{tmp_day=split_date[2];}}
document.MetSearch.from_yearS32.value=split_date[0];document.MetSearch.from_monthS32.value=tmp_month;document.MetSearch.from_dayS32.value=tmp_day;}else{if(split_date[1]==null||split_date[1]==""){tmp_month="12";}else{if(split_date[1].length=="1"){tmp_month="0"+split_date[1];}else{tmp_month=split_date[1];}}
if(split_date[2]==null||split_date[2]==""){if(tmp_month=="02"){tmp_day="28";}else if(tmp_month=="01"&&tmp_month=="03"&&tmp_month=="05"&&tmp_month=="07"&&tmp_month=="08"&&tmp_month=="10"&&tmp_month=="12"){tmp_day="31";}else{tmp_day="30";}}else{if(split_date[2].length=="1"){tmp_day="0"+split_date[2];}else{tmp_day=split_date[2];}}
document.MetSearch.to_yearS32.value=split_date[0];document.MetSearch.to_monthS32.value=tmp_month;document.MetSearch.to_dayS32.value=tmp_day;}
convdate=split_date[0]+tmp_month+tmp_day;return convdate;}
function _xIsNumeric()
{　　var arg=arguments;　　
　　var result=false;　　　　
　　
　　
　　if(arg==null||arg==undefined||arg.length<=0)
　　{　　　　return result;　　}
　　
　　var argValue=null;　　
　　var Value=0;　　　　　　
　　
　　
　　for(var i=0;i<arg.length;i++)
　　{　　　　
　　　　argValue=arg[i];　　　　
　　　　
　　　　if(argValue==undefined)
　　　　{　　　　　　continue;　　　　}
　　　　
　　　　
　　　　Value=Number(argValue);　　　　if(Value.toString()==Infinity.toString())
　　　　{　　　　　　return result;　　　　}
　　　　
　　　　if(isNaN(Value))
　　　　{　　　　　　
　　　　　　return result;　　　　}
　　}
　　
　　
　　return!result;}
function _xFillZero(number,size){var s=Math.log(number)*Math.LOG10E;for(i=1,n=size-s,str="";i<n;i++)str+="0";return str+number;}
function _xEmptyTextField(inForm){_emp='';if(document.forms[inForm]!=null){for(i=0;i<document.forms[inForm].elements.length;i++){var ele=document.forms[inForm].elements[i];if(ele.name!=''&&ele.type=='text'&&ele.value==''){return false;}}}
return true;}
function _xConvNum(text){outstr=text.replace(/０/g,"0");outstr=outstr.replace(/１/g,"1");outstr=outstr.replace(/２/g,"2");outstr=outstr.replace(/３/g,"3");outstr=outstr.replace(/４/g,"4");outstr=outstr.replace(/５/g,"5");outstr=outstr.replace(/６/g,"6");outstr=outstr.replace(/７/g,"7");outstr=outstr.replace(/８/g,"8");outstr=outstr.replace(/９/g,"9");return outstr;}
function _xIsEmpty(val){var empty=true;if(val!=null&&val.length>0){empty=false;}
return empty;}
function _xCheckDateFormat(val){if(_xIsEmpty(val)){return true;}else if(val.search(/^-?[0-9]+(-((0[1-9])|(1[0-2]))-((0[1-9])|([12][0-9])|(3[01])))?$/)!=-1&&-5000000000<=_xGetYear(val)&&_xGetYear(val)<=9999){return true;}else{var msg="The data fomat must be \"YYYY\" or \"YYYY-MM-DD\".\nThe value is: "+val;alert(msg);return false;}}
function _xGetYear(val){var y_val=val.charAt(0);for(i=1;i<val.length;i++){if(val.charAt(i)!='-'){y_val=y_val+val.charAt(i);}else{break;}}
return parseInt(y_val);}
function _xCheckAjaxReq(url){new Ajax.Request(url,{method:"get",onComplete:function(httpObj){XML=httpObj.responseText;alert(XML);},contentType:"text/xml",onFailure:function(httpObj){alert("サーバとの通信に失敗しました。");}});}
var _xUtilFunc={autoScroll:function(xid){if($(xid)){new Effect.ScrollTo(xid,{from:0.0,to:1.0,fps:60,duration:2,beforeStartInternal:function(effect){},afterFinishInternal:function(effect){alert("end");}});}else{alert("not found");}}}