function ge(e) { return document.getElementById(e)}
function paixu(id) {
	if(id!=sort_id) {
		ge("sort"+sort_id).className="bg"
		ge("sort"+id).className="now"
		sort_id=id
	}
}
function showcity() {
	ge("allcity").style.display="block"
}
function sel_city(t) {
	var s
	if(t.title) city=t.title
	else city=t.innerHTML
	setcookie("city",city,8640000*3)
	t.href="city.php?c="+city
	ge("city").innerHTML=city

	s=ge("fenlei").childNodes
	for(var i in s) {
		if(s[i].tagName=="A") s[i].href="city.php?f="+encodeURIComponent(s[i].innerHTML)+"&c="+encodeURIComponent(city)
	}
	s=ge("quan").childNodes
	for(var i in s) {
		if(s[i].tagName=="A") s[i].href="city.php?q="+encodeURIComponent(s[i].innerHTML)+"&c="+encodeURIComponent(city)
	}
	s=ge("sort").childNodes
	var x=0
	for(var i in s) {
		if(s[i].tagName=="A") s[i].href="city.php?c="+encodeURIComponent(city)+"&o="+x
		x++
	}
}

function getcookie(name){var arg = name + "=";var alen = arg.length;var c= document.cookie;var clen =c.length;var i = 0
while (i < clen){var j = i + alen
if (c.substring(i, j) == arg)
return _GetCookieVal (j)
i = c.indexOf(" ", i)+1
if(i == 0) break}return null}
function setcookie(name,value){var expdate = new Date();var argv = setcookie.arguments;var argc = setcookie.arguments.length
var expires = (argc > 2) ? argv[2] : null;var path = (argc > 3) ? argv[3] : null
var domain = (argc > 4) ? argv[4] : null;var secure = (argc > 5) ? argv[5] : false
if(expires!=null) {expdate.setTime(expdate.getTime() + ( expires * 1000 ))}
document.cookie = name + "=" + escape (value) +((expires == null) ? "" : ("; expires="+ expdate.toGMTString()))
+((path == null) ? "" : ("; path=" + path)) +((domain == null) ? "" : ("; domain=" + domain))
+((secure == true) ? "; secure" : "")}
function _GetCookieVal(offset)
{var c= document.cookie;var endstr = c.indexOf (";", offset)
if (endstr == -1) endstr = c.length
return unescape(c.substring(offset, endstr))}
