/*#	首页	#*/

$(function(){
	
	build_weather_area_select('weather_area_select' , '' , get_weather_default_city() ,  'weather_prov' , 'weather_city' );
	
	/*#
		顶部导航图标
	#*/
	$('#Image1').attr('src','images_life/life_089a.jpg')	 ;
	$('#Image1').mouseover(function(){})	;
	$('#Image1').mouseout(function(){})	 ;



	/*#	商业、生活类别树形菜单	#*/
	$('#biz_left_cat_list a').click(left_cat_list_click)	;
	$('#life_left_cat_list a').click(left_cat_list_click)	;
	open_clicked_left_cat()	;
	
	/*#	天气查询	#*/
	$('#btn_weather').click(function(){
		city	=	typeof($('#weather_city').val())!='undefined' ? $('#weather_city').val() : get_weather_default_city()		;
		wurl	=	BASE_URL+'/apps/info/index.php';
		
		$.post(wurl,{m:'weather',act:'getWeatherbyCityName',city:city},function(wjson){

			today	=	new Date()	;
			today_month	=	today.getMonth()+1	;
			today_day	=	today.getDate()	;

			tomorrow	 =	 new Date(today.getFullYear() , today_month-1 , today_day+1)	;
			tomorrow_month	 =	 tomorrow.getMonth()+1	;
			tomorrow_day	 =	 tomorrow.getDate()	;
			
			tdat	=	new Date(today.getFullYear() , tomorrow_month-1 , tomorrow_day+1)	 ;
			tdat_month	=	tdat.getMonth()+1	;
			tdat_day	=	tdat.getDate()	 ;

			$('#weather_today').text( today_month+'-'+today_day )	;
			$('#weather_tomorrow').text( tomorrow_month+'-'+tomorrow_day)	;
			$('#weather_tdat').text( tdat_month+'-'+tdat_day )	;

			$('#weather_today_day').text( get_jp_day(today.getDay()) )	;
			$('#weather_tomorrow_day').text( get_jp_day(tomorrow.getDay()) )	;
			$('#weather_tdat_day').text( get_jp_day(tdat.getDay()) )	 ;
//			$('#weather_today').text( '今日' )	 ;
//			$('#weather_tomorrow').text( '明日' )	;
//			$('#weather_tdat').text( '明後日' )	;
			
			$('#weather_today_t').html( wjson['today']['temperature'][0] )	 ;
			$('#weather_tomorrow_t').html( wjson['tomorrow']['temperature'][0] )	 ;
			$('#weather_tdat_t').html( wjson['ntomorrow']['temperature'][0] )	 ;

			html	=	'<img src="'+BASE_URL+'/apps/info/images/weather/'+wjson['today']['pic_1'][0]+'" width="22" height="20" />'	
			html	=	html + '<img src="'+BASE_URL+'/apps/info/images/weather/'+wjson['today']['pic_2'][0]+'" width="22" height="20" />'	
			$('#weather_today_p').html(html)	;

			html	=	'<img src="'+BASE_URL+'/apps/info/images/weather/'+wjson['tomorrow']['pic_1'][0]+'" width="22" height="20" />'	
			html	=	html + '<img src="'+BASE_URL+'/apps/info/images/weather/'+wjson['tomorrow']['pic_2'][0]+'" width="22" height="20" />'	
			$('#weather_tomorrow_p').html(html)	;

			html	=	'<img src="'+BASE_URL+'/apps/info/images/weather/'+wjson['ntomorrow']['pic_1'][0]+'" width="22" height="20" />'	
			html	=	html + '<img src="'+BASE_URL+'/apps/info/images/weather/'+wjson['ntomorrow']['pic_2'][0]+'" width="22" height="20" />'	
			$('#weather_tdat_p').html(html)	;
		
			$.cookie('weather_city',city)	;

			txt	=	city	;
			from	 =	 'zh-CN'	;
			to	 =	 'ja'	;
			google.language.translate( txt , from , to , function(result){

				if ( !result.error ) {
					$('#weather_city_name').html( result.translation )	;
				}else {
					alert(result.error);
				}
			})	;

		},'json')	;
		

	})	;//$('#btn_weather')


	$('#btn_weather').trigger('click');	
});//--$(function(){