var tsaLiveReq=false;var tsaLiveReqLast="-";var tsaYear=0;var tsaMonth=0;var tsaIsIE=false;if(window.XMLHttpRequest){tsaLiveReq=new XMLHttpRequest();}
function tsaLiveReqDoReq(query){if(tsaLiveReqLast!=query){if(tsaLiveReq&&tsaLiveReq.readyState<4){tsaLiveReq.abort();}
if(window.XMLHttpRequest){}else if(window.ActiveXObject){tsaLiveReq=new ActiveXObject("Microsoft.XMLHTTP");}
tsaLiveReq.onreadystatechange=tsaLiveReqProcessReqChange;tsaLiveReq.open("GET",tsaProcessURI+"?"+query);tsaLiveReqLast=query;tsaLiveReq.send(null);}}
function tsaLiveReqProcessReqChange(){if(tsaLiveReq.readyState==4){var tsaText=tsaLiveReq.responseText;var resultID=tsaText.substring(0,tsaText.indexOf('|'));tsaText=tsaText.substring(tsaText.indexOf('|')+1,tsaText.length);var resultElement=document.getElementById(resultID)
if(resultElement==null)return;resultElement.innerHTML=tsaText;var yearElement=document.getElementById(resultID+'-year')
if(yearElement==null)return;var year_list=yearElement.childNodes;for(var i=0;i<year_list.length;i++){if(year_list[i].nodeName=='LI'){year_list[i].style.cursor='pointer';var tf=function(e){var tsaID=tsaEventElement(e).id;tsaYear=tsaID.substring(tsaID.lastIndexOf('-')+1,tsaID.length);tsaSelectYear();}
if(tsaIsIE){year_list[i].attachEvent('onclick',tf);}else{year_list[i].addEventListener('click',tf,false);}}}
var monthElement=document.getElementById(resultID+'-month');if(monthElement==null)return;var month_list=monthElement.childNodes;for(var i=0;i<month_list.length;i++){if(month_list[i].nodeName=='LI'){month_list[i].style.cursor='pointer';var tf=function(e){var tsaID=tsaEventElement(e).id;tsaMonth=tsaID.substring(tsaID.lastIndexOf('-')+1,tsaID.length);tsaSelectMonth();}
if(tsaIsIE){month_list[i].attachEvent('onclick',tf);}else{month_list[i].addEventListener('click',tf,false);}}}
if(typeof Fat!='undefined'&&/class="fade"/.test(tsaText)){Fat.fade_all();}}}
function tsaLiveReqInit(){if(navigator.userAgent.indexOf("Safari")>0){}else if(navigator.product=="Gecko"){}else{tsaIsIE=true;}
tsaLiveReqDoReq('');}
function tsaSelectYear(){tsaLiveReqDoReq('year='+tsaYear);}
function tsaSelectMonth(){tsaLiveReqDoReq('year='+tsaYear+'&month='+tsaMonth);}
function tsaEventElement(e){if(tsaIsIE){return e.srcElement;}else{return e.currentTarget;}}
function tsaAddEvent(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,true);return true;}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}else{return false;}}
tsaAddEvent(window,'load',tsaLiveReqInit);
