// JavaScript Document
function SelectWeather(t) {
	document.getElementById('check_weather_value').value = t ;
	for( i=1; i<=4; i++ ) {
		if( t == i )
			document.getElementById('weather_btn_'+i).className ="mainbg weather_btn_checked";
		else
			document.getElementById('weather_btn_'+i).className ="mainbg weather_btn_normal";
	}
	
	if( t != 0 && document.getElementById('load_weather_value').value != t ) {
		if( document.getElementById('weatherselect') != null ) document.getElementById('weatherselect').options.selectedIndex = t ;
		var f = document.getElementById('saveform');
		var col = document.getElementById('savecol');
		if( !f ) return false ; //用户不登录找不到提交表单
		f.target = "actionframe";
		f.action = "/DateAction/saveweather";
		col.name = "weather_id";
		col.value = t; 
		f.submit();
	}
}

function WriteDayLogs(btn) {
	//var weathervalue = getElementById('check_weather_value').value ;
	var area = document.getElementById('daylogarea');
	area.style.left = (GetLeft(btn)-100)+'px';
	area.style.top = GetTop(btn)+25+'px';
	area.style.display="block";
}

function CancelDayLogs(){
	var area = document.getElementById('daylogarea');
	area.style.display="none";
}


function ArticleDig(aid) {
	var fm=document.getElementById('digform');
	fm.article_id.value = aid;
	fm.submit() ;
}


function ShowMoreInfo(t) {
	var btn = document.getElementById('morebtn'+t);
	var info = document.getElementById('moreinfo'+t).innerHTML;
	var p = document.getElementById('showmorearea');

	p.style.left = GetLeft(btn)+10; 
	p.style.top  = GetTop(btn)+10 ;

	p.innerHTML = info ; 
	p.style.display = 'block';
	
}

function CloseMoreInfo() {
	document.getElementById('showmorearea').style.display='none';
}

function SkeepMoreInfo() {
	document.getElementById('showmorearea').style.display='block';
}


function LoadDateStatus(d) {
	queryString="d="+d;
	queryUrl="/Action/LoadDateStatus";
	DisplayId="userstatus";
	loadingHtml = " <font color=#666666>正在载入...</font> <img src='/images/default/loading_small.gif'>";
	
	startRequest();
}

function ShowRandArea(btn) {
	var a = document.getElementById('randarea');
	a.style.top = GetTop(btn)+15;
	a.style.left = GetLeft(btn)-30;
	a.style.display = 'block';
}

function CloseRandArea() {
	document.getElementById('randarea').style.display = 'none';
}
					
