var location_url=document.location.href; var city_name='\u4e0a\u6d77'; var skip_set_city=0; var suffix=''; var host_url=''; var site_domain=''; host_url=window.location.host; host_url=host_url.toLowerCase(); site_domain=host_url; function getLoginUser(user){ if(user==''){ ini_top_nav_html(''); }else{ ini_top_nav_html(user.name); } try{ user_page_ini(user); }catch(e){} } function URLEncode (clearString) { var output = ''; var x = 0; clearString = clearString.toString(); var regex = /(^[a-zA-Z0-9-_.]*)/; while (x < clearString.length) { var match = regex.exec(clearString.substr(x)); if (match != null && match.length > 1 && match[1] != '') { output += match[1]; x += match[1].length; } else { if (clearString.substr(x, 1) == ' ') { clearString[x] == ' ' output += '+'; } else { var charCode = clearString.charCodeAt(x); var hexVal = charCode.toString(16); output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase(); } x++; } } return output; } function ini_top_nav_html(login_user){ var city_id=''; city_id=jia_header_get_cookie('jia_city_id'); if(city_id=='shanghai' || city_id=='other'){ var fenzhan=''; }else{ var fenzhan=city_id+'/'; } var tel='400-660-7700'; var div_city_id=city_id; /* var div_city_id=jQuery('#region-wrap').attr('city_id'); if(!div_city_id){ div_city_id=jQuery('#region_wrap').attr('city_id'); }*/ if(city_id){ if(city_id!='shanghai'){ tel='400-880-2600'; } } var app_id='201'; if(site_domain=='zhuangxiu.jia.com'){ app_id='200'; } var returl=URLEncode(location_url); var top_nav_html='
'; if(!login_user){ top_nav_html+='登录'; top_nav_html+=' 注册'; }else{ top_nav_html+=' 欢迎您, '+login_user+' '; top_nav_html+=' 退出 '; top_nav_html+=''; } top_nav_html+='
'; top_nav_html+='