<!--
var url = '';

function setCookie(name, value, expires, path, domain, secure) {
  var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");
  document.cookie = curCookie;
	//parent.frames[0].document.location.reload();
	//alert(url+document.custom.city.value);
	//url = url + document.custom.city.value + '.html';
//	parent.frames[0].document.location.replace(url);
}

function getCookie(name) {
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function replace(string,text,by) {
// Replaces text with by in string
    var i = string.indexOf(text);
    var newstr = '';
    if ((!i) || (i == -1)) return string;
    newstr += string.substring(0,i) + by;

    if (i+text.length < string.length)
        newstr += replace(string.substring(i+text.length,string.length),text,by);
    return newstr;
}
 

function getValue(string,elementName,object,elementType) {
    var startPos = string.indexOf(elementName + "=")
    if (startPos > -1) {
        startPos = startPos + elementName.length + 1;
        var endPos = string.indexOf("&",startPos);
        if (endPos == -1) endPos = string.length;

        var elementValue = unescape(string.substring(startPos,endPos));
        
		if (elementType == "hidden")   object.value = elementValue;
    }
}

function getValues(string) {
    getValue(string,"city",document.custom.city,"hidden");
}

function setupForm() {
    if (userProfile) getValues(userProfile);
	url = url + document.custom.city.value + '_cn.html';
	//frames['city_frame_cn'].document.location=url;
//	parent.frames[0].document.location=url;
	if(document.all) frames['city_frame_cn'].document.location=url;
        else if(document.getElementById) frames[0].document.location=url;
	//frames['city_frame_cn'].document.getElementById("city_frame_cn").src = url;
	//window.top.document.getElementById("city_frame_cn").src = url;
}
function setupForm_new_w() {
    if (userProfile) getValues(userProfile);
	url = url + document.custom.city.value + '_cn2.html';
	//frames['city_frame_cn'].document.location=url;
//	parent.frames[0].document.location=url;
	if(document.all) frames['city_frame_cn'].document.location=url;
        else if(document.getElementById) frames[0].document.location=url;
	//frames['city_frame_cn'].document.getElementById("city_frame_cn").src = url;
	//window.top.document.getElementById("city_frame_cn").src = url;
}
function setupForm_new_n() {
    if (userProfile) getValues(userProfile);
        url = url + document.custom.city.value + '_cn1.html';
        //frames['city_frame_cn'].document.location=url;
//      parent.frames[0].document.location=url;
        if(document.all) frames['city_frame_cn'].document.location=url;
        else if(document.getElementById) frames[0].document.location=url;
        //frames['city_frame_cn'].document.getElementById("city_frame_cn").src = url;
        //window.top.document.getElementById("city_frame_cn").src = url;
}
function setupForm_new_y() {
    if (userProfile) getValues(userProfile);
        url = url + document.custom.city.value + '_cn3.html';
        //frames['city_frame_cn'].document.location=url;
//      parent.frames[0].document.location=url;
        if(document.all) frames['city_frame_cn'].document.location=url;
        else if(document.getElementById) frames[0].document.location=url;
        //frames['city_frame_cn'].document.getElementById("city_frame_cn").src = url;
        //window.top.document.getElementById("city_frame_cn").src = url;
}
function setupForm_new_diy() {
    if (userProfile) getValues(userProfile);
        url = url + document.custom.city.value + '_cn4.html?bg_color='+bg_color+'&font_color='+font_color+'&font_bold='+font_bold;
        //frames['city_frame_cn'].document.location=url;
//      parent.frames[0].document.location=url;
        if(document.all) frames['city_frame_cn'].document.location=url;
        else if(document.getElementById) frames[0].document.location=url;
        //frames['city_frame_cn'].document.getElementById("city_frame_cn").src = url;
        //window.top.document.getElementById("city_frame_cn").src = url;
}
function setupForm_new_diy6() {
    if (userProfile) getValues(userProfile);
        url = url + document.custom.city.value + '_cn6.html?bg_color='+bg_color+'&font_color='+font_color+'&font_bold='+font_bold;
        //frames['city_frame_cn'].document.location=url;
//      parent.frames[0].document.location=url;
        if(document.all) frames['city_frame_cn'].document.location=url;
        else if(document.getElementById) frames[0].document.location=url;
        //frames['city_frame_cn'].document.getElementById("city_frame_cn").src = url;
        //window.top.document.getElementById("city_frame_cn").src = url;
}
function setupForm_xiaofang() {
    if (userProfile) getValues(userProfile);
        url = url + document.custom.city.value + '_xf.html';
        //frames['city_frame_cn'].document.location=url;
//      parent.frames[0].document.location=url;
        if(document.all) frames['city_frame_xiaofang'].document.location=url;
        else if(document.getElementById) frames[0].document.location=url;
        //frames['city_frame_cn'].document.getElementById("city_frame_cn").src = url;
        //window.top.document.getElementById("city_frame_cn").src = url;
}
function redirect() {
	if (userProfile){
		getValues(userProfile)
		//url = url + document.custom.city.value + '_cn.html';
		//if(self.location.pathname.search(document.custom.city.value)<0){ window.location = url;}
	}
}
// -->
