function getCookie(Name) {
   var search = Name + "=";
   if(document.cookie.length > 0) {
      offset = document.cookie.indexOf(search);
      if(offset != -1) {
         offset += search.length;
         end = document.cookie.indexOf(";", offset);
         if(end == -1) end = document.cookie.length;
         return unescape(document.cookie.substring(offset, end));
      }
   }
   return "";
}

function QueryString(fieldName) {
	var urlString = document.location.search;
	if(urlString != null) {
		var typeQu = fieldName+"=";
		var urlEnd = urlString.indexOf(typeQu);
		if(urlEnd != -1) {
			var paramsUrl = urlString.substring(urlEnd+typeQu.length);
			var isEnd =  paramsUrl.indexOf('&');
			if(isEnd != -1) {
				return paramsUrl.substring(0, isEnd);
			} else {
				return paramsUrl;
			}
		} else {
			return null;
		}
	} else {
		return null;
	}
}

//150x80
function showWeather1A(areacode, city, datedesc, legend, weather, temperature, wind) {
	document.write("<div style='LINE-HEIGHT:20px;PADDING:2px;TEXT-ALIGN:center;'>");
	document.write("<a href='http://www.sususo.com/weather/area/" + areacode + ".htm' title='" + datedesc + "&#10;点击查看3日内详细预报' target=_blank>" + city + "</a><br>");
	document.write(legend + " " + weather + "<br>" + temperature + "<br>" + wind);
	document.write("</div>");
}
function showWeather1(areacode, city, datedesc, legend, weather, temperature, wind) {
	document.write("<a href='http://www.sususo.com/weather/area/" + areacode + ".htm' title='" + datedesc + "&#10;点击查看3日内详细预报' target=_blank>");
	document.write("<div style='LINE-HEIGHT:20px;PADDING:2px;TEXT-ALIGN:center;'>");
	document.write(city + "<br>" + legend + " " + weather + "<br>" + temperature + "<br>" + wind);
	document.write("</div></a>");
}

//150x40
function showWeather2A(areacode, city, datedesc, legend, weather, temperature, wind) {
	document.write("<div nowrap style='LINE-HEIGHT:20px;PADDING:2px;TEXT-ALIGN:center;'>");
	document.write("<a href='http://www.sususo.com/weather/area/" + areacode + ".htm' title='" + datedesc + "&#10;点击查看3日内详细预报' target=_blank>" + city + "</a> ");
	document.write(legend + " " + weather + "<br>" + temperature + " " + wind);
	document.write("</div>");
}
function showWeather2(areacode, city, datedesc, legend, weather, temperature, wind) {
	document.write("<a href='http://www.sususo.com/weather/area/" + areacode + ".htm' title='" + datedesc + "&#10;点击查看3日内详细预报' target=_blank>");
	document.write("<div nowrap style='LINE-HEIGHT:20px;PADDING:2px;TEXT-ALIGN:center;'>");
	document.write(city + " "+ legend + " " + weather + "<br>" + temperature + " " + wind);
	document.write("</div></a>");
}

//300x24
function showWeather3A(areacode, city, datedesc, legend, weather, temperature, wind) {
	document.write("<div nowrap style='LINE-HEIGHT:20px;PADDING:2px;'>");
	document.write("<a href='http://www.sususo.com/weather/area/" + areacode + ".htm' title='" + datedesc + "&#10;点击查看3日内详细预报' target=_blank>" + city + "</a> ");
	document.write(legend + " " + weather + " " + temperature + " " + wind);
	document.write("</div>");
}
function showWeather3(areacode, city, datedesc, legend, weather, temperature, wind) {
	document.write("<a href='http://www.sususo.com/weather/area/" + areacode + ".htm' title='" + datedesc + "&#10;点击查看3日内详细预报' target=_blank>");
	document.write("<div nowrap style='LINE-HEIGHT:20px;PADDING:2px;'>");
	document.write(city + " " + legend + " " + weather + " " + temperature + " " + wind);
	document.write("</div></a>");
}

function showErrMsg() {
	document.write("<a href='http://www.sususo.com/weather/' title='代码投放错误' target=_blank>速速搜天气预报</a>");
}
