未命名  

<script type="text/javascript">
  var city = new Array("安徽","黑龙江","山东","北京","湖北","山西","福建","湖南","陕西","甘肃","吉林","上海","广东","江苏","四川","广西","江西","天津","贵州","辽宁","西藏","海南","内蒙古","新疆","河北","宁夏","云南","河南","青海","浙江","重庆");
  var weaths = new Array('58321','50953','54823','54511','57494','53772','59134','57679','57036','52889','54172','58367',
'59287','58238','56294','59431','58606','54527','57816','54342','55591','52856','53463','51463','53698','53614','56778',
'57083','52866','58457','57516');
function getCookieVal (offset) {
var endstr = document.cookie.indexOf (";", offset);
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offset, endstr));
}
function GetCookie (name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0)
 break;
 }
 return "";
 }
 function SetCookie(cookieName,cookieValue,nDays) {
 var today = new Date();
 var expire = new Date();
 if (nDays==null || nDays==0) nDays=1;
 expire.setTime(today.getTime() + 3600000*24*nDays);
 document.cookie = cookieName+"="+escape(cookieValue) + ";path=/;domain=.163.com;expires="+expire.toGMTString();
 }
 function getCityWeatherID(cityname){
 for(i=0;i<city.length;i++){ 
 if(city[i]==cityname){
 return weaths[i];
 }
 }
 return "54511";
 }
 var NTES_WeatherAddr = GetCookie("NTES_WeatherAddr");
 if (!NTES_WeatherAddr){
 var loc = GetCookie("theaddr");
 if(!loc){
 document.write("<script type='text/javascript' src='http://202.108.39.152/ipquery'><" + "/script>");
 }
 }
</script>
<script type="text/javascript">
  if (!NTES_WeatherAddr){
  NTES_WeatherAddr=getCityWeatherID(loc);
   NTES_WeatherAddr=getCityWeatherID(loc);
 
  }
  window.location.href="http://news.163.com/weather/news/qx1/"+NTES_WeatherAddr+".html";
//  function showWeatherByAnthem() {
//   Anthem_InvokePageMethod("ShowWeatherByAnthem", [], getServerResult);
//   function getServerResult(result) {
//   ocument.getElementById("result").innerHTML = result.value;
//   }
//   function showWeatherByCallBack(){
//   var context=document.getElementById("result");
//   var weatherUrl=document.getElementById("Text1");
//   var arg="ShowWeatherByCall|" + weatherUrl.value;
//   }
//   function outPutResult(result) {
//   document.getElementById("result").innerHTML = result;}
</script>

創作者介紹
創作者 shadow 的頭像
shadow

資訊園

shadow 發表在 痞客邦 留言(0) 人氣()