function wShow(Obj)
{
//----------------------------------------------------------
//切换显示
//----------------------------------------------------------
	oH=parseInt(Obj.parentNode.style.height.replace("px",""))		
	oW=parseInt(Obj.parentNode.style.width.replace("px",""))

	PosX=Obj.parentNode.offsetLeft
	PosY=Obj.parentNode.offsetTop
	with(document.getElementById("wTable").style)
	{
		if(display=="")
		{
			display="none"
			position="absolute"				
			left	=PosX
			top	=PosY+oH				
		}
		else
		{
			display=""
			position="absolute"				
			left	=PosX-280
			top	=PosY+oH				
		}
	}
}
var wCity=new Array() //城市名称
var wUrl	=new Array() //Rss路径

wCity[0]	="北市"	
wCity[1]	="高市"	
wCity[2]	="基隆"
wCity[3]	="台北"	
wCity[4]	="桃园"	
wCity[5]	="新竹"	
wCity[6]	="苗栗"	
wCity[7]	="台中"	
wCity[8]	="彰化"	
wCity[9]	="南投"	
wCity[10]="云林"	
wCity[11]="嘉义"	
wCity[12]="台南"	
wCity[13]="高雄"	
wCity[14]="屏东"	
wCity[15]="恒春"	
wCity[16]="宜兰"	
wCity[17]="花莲"	
wCity[18]="台东"	
wCity[19]="澎湖"	
wCity[20]="金门"	
wCity[21]="马祖"	

wUrl[0]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_01.xml"	
wUrl[1]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_02.xml"	
wUrl[2]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_03.xml"
wUrl[3]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_04.xml"	
wUrl[4]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_05.xml"	
wUrl[5]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_06.xml"	
wUrl[6]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_07.xml"	
wUrl[7]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_08.xml"	
wUrl[8]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_09.xml"	
wUrl[9]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_10.xml"	
wUrl[10]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_11.xml"	
wUrl[11]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_12.xml"	
wUrl[12]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_13.xml"	
wUrl[13]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_14.xml"	
wUrl[14]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_15.xml"	
wUrl[15]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_16.xml"	
wUrl[16]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_17.xml"	
wUrl[17]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_18.xml"	
wUrl[18]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_19.xml"	
wUrl[19]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_20.xml"	
wUrl[20]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_21.xml"	
wUrl[21]	="http://www.wed168.com.cn/gate/gb/www.cwb.gov.tw/V5/rss/forecast/36_22.xml"	


BTable()

function BTable()
{
//----------------------------------------------------------
//建立县市表格
//----------------------------------------------------------

	var Total=wCity.length
	var PSize=8
	var PNos =Math.ceil(Total/PSize)
	//alert(PNos)

	var oTable=document.getElementById("wTable")

	for(var i=1;i<=PNos;i++)
	{
		var s=1+(PSize*(i-1))		
		var e=i*PSize

		var oRow =oTable.insertRow(-1)
		for(var j=s;j<=e;j++)
		{
			if(j<=Total)
			{
				var oCell=oRow.insertCell(-1)
				oCell.style.width="80px"

				var oHTML=""
				oHTML=oHTML + "<A Href=javascript:Fn01('wSpan','" + wCity[j-1] + "','" + wUrl[j-1] + "');void(0)>"
				oHTML=oHTML + wCity[j-1]
				oHTML=oHTML + "</A>"
				oCell.innerHTML=oHTML		
			}
			else
			{
				var oCell=oRow.insertCell(-1)
				oCell.style.width="80px"
				oCell.innerHTML="&nbsp;"					
			}
		}		
	}
}

function Fn01(oID,wcity,wurl)
{
//----------------------------------------------------------
//事件处理程序
//----------------------------------------------------------
//oID		物件ID
//wcity  城市名称
//wurl	Rss路径
//----------------------------------------------------------
	
	//alert(oID+","+wcity+","+wurl)	
	
	//取回oXMLHttp物件
	var oXMLHttp=gXMLHttp()
	if(!oXMLHttp){return false;}

	//处理区块
	{
		//-------------------------------------------------------
		//送出查询
		//-------------------------------------------------------
		var sUrl="" 
		sUrl=sUrl + "../Weather/BEnd.asp?"
		sUrl=sUrl + "wcity=" + escape(wcity) + "&"		
		sUrl=sUrl + "wurl=" + wurl		
		//alert(sUrl)

		oXMLHttp.open("Get",sUrl,true);
		oXMLHttp.send(null);		  

		//-------------------------------------------------------
		//联机状态处理
		//-------------------------------------------------------
		var o=document.getElementById(oID)
		o.innerHTML="加载中.."

		oXMLHttp.onreadystatechange=function()
		{
			//判断处理状态
			if (oXMLHttp.readyState == 4) 
			{
				if (oXMLHttp.status == 200) 
				{
					//加载成功
					var gText=oXMLHttp.responseText

					//alert(gText)
					o.innerHTML=gText
					return true;				
				} 
				else 
				{
					//加载失败
					var gText="加载失败..."
					
					//alert(gText)
					o.innerHTML=gText
					return false;
				}
			}		
		}
	}
}
function show_sele()
{
	var o=document.getElementById('sele')
	if(o.style.display=="none")
	{
	o.style.display=""
	}
	else
	{
	o.style.display="none"
	}
}
function close_sele()
{
	var o=document.getElementById('sele')
	o.style.display="none"
}
