//各种天气现象列表：天气现象代号,天气现象名称,小图标名
wm=new Array();
wm[1]=new weather_mod('1','晴','images/sun.gif');
wm[2]=new weather_mod('2','多云','images/yun.gif');
wm[3]=new weather_mod('3','小雨','images/yu.gif');
wm[4]=new weather_mod('4','晴转多云','images/yun.gif');
wm[5]=new weather_mod('5','风','images/feng.gif');
wm[6]=new weather_mod('6','小雪','images/xue.gif');
wm[7]=new weather_mod('7','小雨转多云','images/yu.gif');
wm[8]=new weather_mod('8','阴转多云','images/yin.gif');
wm[9]=new weather_mod('9','多云转晴','images/yun.gif');
wm[10]=new weather_mod('10','中雨转阴','images/yu.gif');
wm[11]=new weather_mod('11','小雪转多云','images/xue.gif');
wm[12]=new weather_mod('12','晴转雾','images/sun.gif');
wm[13]=new weather_mod('13','阴','images/yin.gif');
wm[14]=new weather_mod('14','小雨转阴','images/yu.gif');
wm[15]=new weather_mod('15','中雨','images/yu.gif');
wm[16]=new weather_mod('16','多云转小雪','images/xue.gif');
wm[17]=new weather_mod('17','多云转阴','images/yin.gif');
wm[18]=new weather_mod('18','小雪转阴','images/xue.gif');
wm[19]=new weather_mod('19','雾','images/wu.gif');
wm[20]=new weather_mod('20','大雾','images/wu.gif');
wm[21]=new weather_mod('21','小雨转雨夹雪','images/xue.gif');
wm[22]=new weather_mod('22','雨夹雪','images/xue.gif');
wm[23]=new weather_mod('23','多云转小雨','images/yu.gif');
wm[24]=new weather_mod('24','阴转小雪','images/xue.gif');
wm[25]=new weather_mod('25','阴转小雨','images/yu.gif');
wm[26]=new weather_mod('26','中雨转小雨','images/yu.gif');
wm[27]=new weather_mod('27','阵雪转小雨','images/yu.gif');
wm[28]=new weather_mod('28','雨夹雪转小雨','images/xue.gif');
wm[29]=new weather_mod('29','阴转晴','images/sun.gif');
wm[30]=new weather_mod('30','雨夹雪转多云','images/xue.gif');
wm[31]=new weather_mod('31','雷阵雨','images/yu.gif');
wm[32]=new weather_mod('32','雨夹雪','images/xue.gif');
wm[33]=new weather_mod('33','多云转阵雪','images/xue.gif');
wm[34]=new weather_mod('34','雾转多云','images/yun.gif');
wm[35]=new weather_mod('35','晴转阴','images/yin.gif');
wm[36]=new weather_mod('36','雾转晴','images/sun.gif');
wm[37]=new weather_mod('37','雾转小雨','images/yu.gif');
wm[38]=new weather_mod('38','晴转小雨','images/yu.gif');
wm[39]=new weather_mod('39','小雨转中雨','images/yu.gif');
wm[40]=new weather_mod('40','多云转雾','images/yun.gif');
wm[41]=new weather_mod('41','中雪转小雪','images/xue.gif');
wm[42]=new weather_mod('42','大雪转小雪','images/xue.gif');
wm[43]=new weather_mod('43','阵雪转晴','images/xue.gif');
wm[44]=new weather_mod('44','晴转小雪','images/xue.gif');
wm[45]=new weather_mod('45','大雨','images/yu.gif');
wm[46]=new weather_mod('46','多云转雷阵雨','images/yu.gif');
wm[47]=new weather_mod('47','雾转阴','images/yin.gif');
wm[48]=new weather_mod('48','多云转雨夹雪','images/xue.gif');
wm[49]=new weather_mod('49','阵雪转中雪','images/xue.gif');
wm[50]=new weather_mod('50','阴转雨夹雪','images/xue.gif');
wm[51]=new weather_mod('51','雾转雨夹雪','images/xue.gif');
wm[52]=new weather_mod('52','小雪转大雪','images/xue.gif');
wm[53]=new weather_mod('53','中雪','images/xue.gif');
wm[54]=new weather_mod('54','大雪转中雪','images/xue.gif');
wm[55]=new weather_mod('55','雷阵雨转多云','images/yun.gif');
wm[56]=new weather_mod('56','小雪转晴','images/sun.gif');
wm[57]=new weather_mod('57','阴转阵雪','images/sun.gif');
wm[58]=new weather_mod('58','阵雪转多云','images/xue.gif');
wm[59]=new weather_mod('59','雨夹雪转中雪','images/xue.gif');
wm[60]=new weather_mod('60','中雨转大雨','images/yu.gif');
wm[61]=new weather_mod('61','阴转中雪','images/xue.gif');
wm[62]=new weather_mod('62','多云转中雪','images/xue.gif');
wm[63]=new weather_mod('63','小雨转大雪','images/xue.gif');
wm[64]=new weather_mod('64','小雨转大雨','images/yu.gif');
wm[65]=new weather_mod('65','中雨转中雪','images/xue.gif');
wm[66]=new weather_mod('66','小雨转大雨','images/yu.gif');
wm[67]=new weather_mod('67','阵雪','images/xue.gif');
wm[68]=new weather_mod('68','小雪转中雪','images/xue.gif');
wm[69]=new weather_mod('69','大雨转小雨','images/yu.gif');
wm[70]=new weather_mod('70','雨夹雪转大雪','images/xue.gif');
wm[71]=new weather_mod('71','大雨转中雨','images/yu.gif');
wm[72]=new weather_mod('72','中雪转多云','images/xue.gif');
wm[73]=new weather_mod('73','中雨转大雪','images/xue.gif');
wm[74]=new weather_mod('74','中雨转雨夹雪','images/xue.gif');
wm[75]=new weather_mod('75','小雨转晴','images/yu.gif');
wm[76]=new weather_mod('76','中雪转阴','images/xue.gif');
wm[77]=new weather_mod('77','阴转中雨','images/yu.gif');
wm[78]=new weather_mod('78','雾转小雪','images/xue.gif');
wm[79]=new weather_mod('79','冻雨转小雨','images/yu.gif');
wm[80]=new weather_mod('80','雨夹雪转阴','images/yu.gif');
wm[81]=new weather_mod('81','晴转雨夹雪','images/xue.gif');
wm[82]=new weather_mod('82','冻雨转阴','images/yin.gif');
wm[83]=new weather_mod('83','小雪转雾','images/xue.gif');
wm[84]=new weather_mod('84','雨夹雪转雾','images/xue.gif');
wm[85]=new weather_mod('85','大雪','images/xue.gif');
wm[86]=new weather_mod('86','阵雪转阴','images/xue.gif');
wm[87]=new weather_mod('87','阴转雾','images/yin.gif');
wm[88]=new weather_mod('88','雨夹雪转小雪','images/xue.gif');
wm[89]=new weather_mod('89','中雨转小雪','images/yu.gif');
wm[90]=new weather_mod('90','雷阵雨转晴','images/yu.gif');
wm[91]=new weather_mod('91','雾转中雨','images/wu.gif');
wm[92]=new weather_mod('92','多云转雷阵雨','images/yun.gif');
wm[93]=new weather_mod('93','雷阵雨转大雨','images/yu.gif');
wm[94]=new weather_mod('94','雷阵雨转阴','images/yu.gif');
wm[95]=new weather_mod('95','雷阵雨转小雨','images/yu.gif');
wm[96]=new weather_mod('96','雷阵雨转阴','images/yu.gif');
wm[97]=new weather_mod('97','雷阵雨转阴','images/yu.gif');
wm[98]=new weather_mod('98','雨夹雪转晴','images/xue.gif');
wm[99]=new weather_mod('99','小雨转雾','images/yu.gif');
wm[100]=new weather_mod('100','中雪转大雪','images/xue.gif');
wm[101]=new weather_mod('101','中雪转阵雪','images/xue.gif');
wm[102]=new weather_mod('102','小雨转中雪','images/xue.gif');
wm[103]=new weather_mod('103','大雪转多云','images/xue.gif');
wm[104]=new weather_mod('104','阴转雷阵雨','images/yu.gif');
wm[105]=new weather_mod('105','小雨转雷阵雨','images/yu.gif');
wm[106]=new weather_mod('106','暴雪转中雪','images/xue.gif');
wm[107]=new weather_mod('107','小雪转阵雪','images/xue.gif');
wm[108]=new weather_mod('108','雷阵雨转中雨','images/yu.gif');
wm[109]=new weather_mod('109','多云转中雨','images/yu.gif');
wm[110]=new weather_mod('110','雷阵雨转暴雨','images/yu.gif');
wm[111]=new weather_mod('111','暴雨转大雨','images/yu.gif');
wm[112]=new weather_mod('112','暴雨','images/yu.gif');
wm[113]=new weather_mod('113','小雨转暴雨','images/yu.gif');
wm[114]=new weather_mod('114','多云转大雨','images/yu.gif');
wm[115]=new weather_mod('115','暴雨转小雨','images/yu.gif');
wm[116]=new weather_mod('116','暴雨转中雨','images/yu.gif');
wm[117]=new weather_mod('117','中雨转暴雨','images/yu.gif');
wm[118]=new weather_mod('118','中雨转多云','images/yu.gif');
wm[119]=new weather_mod('119','阴转暴雨','images/yu.gif');
wm[120]=new weather_mod('120','大雨转暴雨','images/yu.gif');
wm[121]=new weather_mod('121','暴雨转雷阵雨','images/yu.gif');
wm[122]=new weather_mod('122','大暴雨转暴雨','images/yu.gif');
wm[123]=new weather_mod('123','暴雨转多云','images/yu.gif');
wm[124]=new weather_mod('124','中雨转雷阵雨','images/yu.gif');
wm[125]=new weather_mod('125','大雨转多云','images/yu.gif');
wm[126]=new weather_mod('126','暴雨转大暴雨','images/yu.gif');
wm[127]=new weather_mod('127','大雨转雷阵雨','images/yu.gif');
wm[128]=new weather_mod('128','雾转雷阵雨','images/yu.gif');
wm[129]=new weather_mod('129','大雨转阴','images/yu.gif');
wm[130]=new weather_mod('130','雾转暴雨','images/yu.gif');
wm[131]=new weather_mod('131','中雪转小雨','images/yu.gif');
wm[132]=new weather_mod('132','小雨转小雪','images/xue.gif');
wm[133]=new weather_mod('133','中雪转晴','images/xue.gif');
wm[134]=new weather_mod('134','多云转大雪','images/xue.gif');
wm[135]=new weather_mod('135','小雨转冻雨','images/yu.gif');
wm[136]=new weather_mod('136','晴转阵雪','images/sun.gif');
wm[137]=new weather_mod('137','冻雨转雨夹雪','images/yu.gif');   
wm[138]=new weather_mod('138','阵雪转小雪','images/yu.gif');  
wm[139]=new weather_mod('139','阴转大雪','images/xue.gif'); 
wm[140]=new weather_mod('140','小雪转雨夹雪','images/xue.gif'); 
function pollution(city_name,air_quatity,chief_item)
{
	this.city_name=city_name;
	this.air_quatity=air_quatity;
	this.chief_item=chief_item;
}

function today_weather(city_name,pos_ltx,pos_lty,weather_id,top_tem,bottom_tem,air_pol,if_show)
{
	this.city_name=city_name;
	this.pos_ltx=pos_ltx;
	this.pos_lty=pos_lty;
	this.weather_id=weather_id;
	this.top_tem=top_tem;
	this.bottom_tem=bottom_tem;
	this.air_pol=air_pol;
	this.showcity=City_show;
	this.if_show=if_show;
}

function City_show(divname,ddw,ddh,isns,n)
{
	//cc='<a href=# onmouseover=show_detail('+n+',isns'+')><img src='+wm[this.weather_id].weather_img+' width=17 height=17 border=0 alt='+cw[n].city_name+'></a>';
	if(!isns)
	{
		divname.style.left=ddw+this.pos_ltx+37;
		divname.style.top=ddh+this.pos_lty+148;
		divname.style.visibility='visible';
		//divname.innerHTML=cc;
	}
	if(isns) 
	{
		divname.left=ddw+this.pos_ltx+37;
		divname.top=ddh+this.pos_lty+148;
		divname.visibility='visible';
		//divname.document.open();
		//divname.document.write(cc);
		//divname.document.close();
	}
}

function weather_mod(weather_id,weather_text,weather_img)
{
	this.weather_id=weather_id;
	this.weather_text=weather_text;
	this.weather_img=weather_img;
}

divwy=new Array(20,105,158,203,250,293,341,389);
isns = navigator.appName == "Netscape";

function init()
{
	
	ddw=60;
	ddh=0;
	if (window.screen.width>800) {ddw=170;ddh=50;}
		
	//开始:计算日期
	dt=new Date();
	yy='2002';
	mm=dt.getMonth()+1;
	dd=dt.getDate();
	if(mm<10) mm="0"+mm;
	if(dd<10) dd="0"+dd;
	//结束:计算日期
	
	if(isns)
	{
		document.back.left=ddw;
		document.back.top=ddh;
		document.loading.visibility='hidden';
		document.back.visibility='visible'
		for(i=0;i<=7;i++) 
		{
			eval('document.weath'+i+'.left=ddw+525+25');
			eval('document.weath'+i+'.top=ddh+divwy['+i+']');
		}
		with(cw[1])
		{
			document.weath1.document.open();document.weath1.document.write('<b>'+city_name+'</b>');document.weath1.document.close();
			document.weath2.document.open();document.weath2.document.write('<p>'+wm[weather_id].weather_text+'</p>');document.weath2.document.close();
			document.weath3.document.open();document.weath3.document.write('<p>'+top_tem+'</p>');document.weath3.document.close();
			document.weath4.document.open();document.weath4.document.write('<p>'+bottom_tem+'</p>');document.weath4.document.close();
			document.weath5.document.open();document.weath5.document.write('<p>'+air_pol+'</p>');document.weath5.document.close();
			document.weath6.document.open();document.weath6.document.write('<p>'+''+'</p>');document.weath6.document.close();
			document.weath7.document.open();document.weath7.document.write('<p>'+''+'</p>');document.weath7.document.close();
			for (j=1;j<=pw.length-1;j++)
			{
				if (pw[j].city_name==city_name) 
				{	document.weath6.document.open();document.weath6.document.write('<p>'+pw[j].air_quatity+'</p>');document.weath6.document.close();
					document.weath7.document.open();document.weath7.document.write('<p>'+pw[j].chief_item+'</p>');document.weath7.document.close();
				}
			}
		}
		document.weath0.document.open();document.weath0.document.write('<b>'+yy+'.'+mm+'.'+dd+'</b>');document.weath0.document.close();
	}
	else 
	{ 
		back.style.left=ddw;
		back.style.top=ddh;
		loading.style.visibility='hidden';
		back.style.visibility='visible'
		for(i=0;i<=7;i++) 
		{
			eval('weath'+i+'.style.left=ddw+525');
			eval('weath'+i+'.style.top=ddh+divwy['+i+']');
		}
		with(cw[1])
		{
			weath1.innerHTML=city_name;
			weath2.innerHTML=wm[weather_id].weather_text;
			weath3.innerHTML=top_tem;
			weath4.innerHTML=bottom_tem;
			weath5.innerHTML=air_pol;
			weath6.innerHTML='';
			weath7.innerHTML='';
			for (j=1;j<=pw.length-1;j++)
			{
				if (pw[j].city_name==city_name) 
				{	weath6.innerHTML=pw[j].air_quatity;
					weath7.innerHTML=pw[j].chief_item;
				}
			}
		}
		weath0.innerHTML='<b>'+yy+'.'+mm+'.'+dd+'</b>';
	}
	for(i=1;i<=cw.length-1;i++)
	{
		if (cw[i].if_show==1)
		{
		if(!isns)
			eval('cw['+i+'].showcity(city'+i+',ddw,ddh,isns,'+i+')');
		else 
			eval('cw['+i+'].showcity(document.city'+i+',ddw,ddh,isns,'+i+')');
		}
	}
	
}	

function show_detail(n,isns)
{
	if(isns)
	{
		with(cw[n])
		{
			document.weath1.document.open();document.weath1.document.write('<b>'+city_name+'</b>');document.weath1.document.close();
			document.weath2.document.open();document.weath2.document.write('<p>'+wm[weather_id].weather_text+'</p>');document.weath2.document.close();
			document.weath3.document.open();document.weath3.document.write('<p>'+top_tem+'</p>');document.weath3.document.close();
			document.weath4.document.open();document.weath4.document.write('<p>'+bottom_tem+'</p>');document.weath4.document.close();
			document.weath5.document.open();document.weath5.document.write('<p>'+air_pol+'</p>');document.weath5.document.close();
			document.weath6.document.open();document.weath6.document.write('<p>'+''+'</p>');document.weath6.document.close();
			document.weath7.document.open();document.weath7.document.write('<p>'+''+'</p>');document.weath7.document.close();
			for (j=1;j<=pw.length-1;j++)
			{
				if (pw[j].city_name==city_name) 
				{	document.weath6.document.open();document.weath6.document.write('<p>'+pw[j].air_quatity+'</p>');document.weath6.document.close();
					document.weath7.document.open();document.weath7.document.write('<p>'+pw[j].chief_item+'</p>');document.weath7.document.close();
				}
			}
		}
		document.back.document.scf.scs.options[n-1].selected=true;
	}
	else
	{
		with(cw[n])
		{
			weath1.innerHTML=city_name;
			weath2.innerHTML=wm[weather_id].weather_text;
			weath3.innerHTML=top_tem;
			weath4.innerHTML=bottom_tem;
			weath5.innerHTML=air_pol;
			weath6.innerHTML='';
			weath7.innerHTML='';
			for (j=1;j<=pw.length-1;j++)
			{
				if (pw[j].city_name==city_name) 
				{	weath6.innerHTML=pw[j].air_quatity;
					weath7.innerHTML=pw[j].chief_item;
				}
			}
		}
		scf.scs.options[n-1].selected=true;
	}
}
