/* watch list */
function watchsubmit(mu,tu,mode){
 var watch=document.tlbmwatchcnt;
 watch.mainuser.value=mu;
 watch.targetuser.value=tu;
 watch.mode.value=mode;
 watch.submit();
}
function onloadwatch(){
	Effect.Fade('comment', { duration: 15.0 });
}
/* watch user */
function OnloadWac(strget,area,pref){
	strget=strget+"&mode=watch";
	onLoadTL('wac_timeline',strget)
	OnLoadGM('wac_map');
}
function OnloadNoWac(){
	document.getElementById('wac_timeline').innerHTML="該当データは見つかりませんでした。";
	document.getElementById('wac_map').innerHTML="該当データは見つかりませんでした。";
}
function PrefectureSelect(code){
  	new Ajax.Request('http://www.seunze.com/getpref.html?id='+code,{onSuccess:setprefs});	
}

function setprefs(oj){
 var res = oj.responseText;
 var watchappref = document.getElementById("watchappref");
 var optionIndex = watchappref.options.length;
 for (i = 0; i <= optionIndex; i++) {
 	watchappref.options[0] = null
 }
 watchappref.options[0] = new Option("都道府県を選択", 0);
 var len=0;
 if(res!=""){
 	var prefs=res.split(':');
	len=prefs.length;
 	watchappref.options[1] = new Option("全て", "PREF00");
 	for (i = 0; i < len; i++) {
 		var id_name=prefs[i].split(',');
		watchappref.options[i+2] = new Option(id_name[1], id_name[0]);
	}
	document.tlbmwatch.watchappref.value=pref;
	pref="0";
 }
}
function wacprefon(){
	if(document.tlbmwatch.watchplc.checked==true){
		document.tlbmwatch.watchaparea.disabled=false;
		document.tlbmwatch.watchappref.disabled=false;
	}else{
		document.tlbmwatch.watchaparea.disabled=true;
		document.tlbmwatch.watchappref.disabled=true;
	}
}
function prefset(area){
	wacprefon();
	document.tlbmwatch.watchaparea.value=area;
	PrefectureSelect(area);
}
