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 "null";
}

function read(what) {
ret=""; img=""
if ((what == "links") && (GetCookie("lnk1") != "null")) {
for (i=1; i<=3; i++) {
ret+="<A HREF=\""+((GetCookie('lnk'+i) != "null") ? GetCookie('lnk'+i) : "")+"\">"+((GetCookie('nme'+i) != "null") ? GetCookie('nme'+i) : "")+"</A><P>"
}
}
if (what == "weather") {
for (i=1; i<=2; i++) {
img="http://banners.wunderground.com/banner/gizmotimetemp/US/"+((GetCookie('ste'+i) != "null") ? GetCookie('ste'+i) : "TX")+"/"+((GetCookie('cty'+i) != "null") ? GetCookie('cty'+i) : "Dallas")+".gif"
lnk="http://www.wunderground.com/US/"+((GetCookie('ste'+i) != "null") ? GetCookie('ste'+i) : "TX")+"/"+((GetCookie('cty'+i) != "null") ? GetCookie('cty'+i) : "Dallas")+".html"
ret+="<b>"+((GetCookie('cty'+i) != "null") ? GetCookie('cty'+i) : "Dallas")+", "+((GetCookie('ste'+i) != "null") ? GetCookie('ste'+i) : "TX")+":</b><br><A HREF=\""+lnk+"\"><IMG SRC=\""+img+"\"></A><br>"
}
}
if (what == "news") {
ret+="<SCRIPT LANGUAGE=\"JavaScript\""
ret+="SRC=\"http://affiliates.excite.com/affiliates/?"
ret+="section=newslocal&"
ret+="state="+((GetCookie('nst') != "null") ? GetCookie('nst') : "TX")+"&"
ret+="aid=679717&"
ret+="tablewidth=100%\""
ret+="></SCRIPT>"
}
return ret
}