function pageX(b){return b.offsetParent?(b.offsetLeft+pageX(b.offsetParent)):b.offsetLeft}function pageY(b){return b.offsetParent?(b.offsetTop+pageY(b.offsetParent)):b.offsetTop}$("#sugclose").click(function(){$("#sugview").hide()});$(document).click(function(){$("#sugview").hide()});var pjsug={stSrc:"http://suggestion.pujia.com/bussuggest/bussuggest",ctSrc:"http://suggestion.pujia.com/citysuggest/citysuggest",sugSrc:"http://suggestion.pujia.com/360/suggest",infoSrc:"http://suggestion.pujia.com/360/suggest",shopSrc:"http://suggestion.pujia.com/itemsearch",loupanSrc:"http://my.pujia.com/fabu/scopesuggest",type:"info",init:function(g,f,j,h,i){if(!g||!f){return}this.currentInput=(typeof g==="string")?this.G(g):g;this.what=f;if(this.type==="shop"){this.sugSrc=this.shopSrc}else{if(this.type==="bs"){this.sugSrc=this.stSrc}else{if(this.type==="ct"){this.sugSrc=this.ctSrc}else{if(this.type==="loupan"){this.sugSrc=this.loupanSrc}else{this.sugSrc=this.infoSrc}}}}if(j){this.nextInput=(typeof j==="string")?this.G(j):j}else{this.nextInput=null}if(h){this.SGV=(typeof h==="string")?this.G(h):h}else{this.SGV=this.G("sugview")}this.SGV.style.display="none";if(i){this.SG=(typeof i==="string")?this.G(i):i}else{this.SG=this.G("sugcont")}this.JP=this.G("jsonp");this.jca={kw:[],ci:[]};this.vca={kw:"",ci:"",hc:"\u5982\uff1a\u9910\u9986\uff0c\u5bbe\u9986\uff0c\u80af\u5fb7\u57fa"};this.changeif=true;this.selindex=-1;mybrowser={version:(navigator.userAgent.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/i.test(navigator.userAgent),opera:/opera/i.test(navigator.userAgent),msie:/msie/i.test(navigator.userAgent)&&!/opera/.test(navigator.userAgent),mozilla:/mozilla/i.test(navigator.userAgent)&&!/(compatible|webkit)/.test(navigator.userAgent)};this.jshq=null;if(this.currentInput.addEventListener){this.currentInput.addEventListener("input",this.domstart,false);if(mybrowser.opera){this.currentInput.addEventListener("keypress",this.keyctrl,false)}else{this.currentInput.addEventListener("keydown",this.keyctrl,false)}}else{this.currentInput.attachEvent("onpropertychange",this.iestart);this.currentInput.attachEvent("onkeydown",this.keyctrl)}},G:function(b){return document.getElementById(b)},C:function(b){return document.createElement(b)},iestart:function(b){if(b.propertyName!="value"){return}pjsug.start()},domstart:function(){pjsug.start()},keyctrl:function(b){pjsug.swh(b,pjsug.what)},uninit:function(){if(this.currentInput.removeEventListener){this.currentInput.removeEventListener("input",this.domstart,false);if(mybrowser.opera){this.currentInput.removeEventListener("keypress",this.keyctrl,false)}else{this.currentInput.removeEventListener("keydown",this.keyctrl,false)}}else{this.currentInput.detachEvent("onpropertychange",this.iestart);this.currentInput.detachEvent("onkeydown",this.keyctrl)}},start:function(){if(this.currentInput.value==this.vca.hc){return}if(!this.JP){this.JP=this.C("div");this.JP.id="jsonp";document.body.appendChild(this.JP)}if(this.what=="ci"){if(this.currentInput.value.trim()==""){this.vca.ci="";this.SGV.style.display="none";return}if(this.changeif){this.JP.innerHTML="";var d=this.jca.ci.length;if(d>100){this.jca.ci.splice(99)}for(var e=0;e<d;e++){if(this.currentInput.value==this.jca.ci[e][0]){area(this.jca.ci[e],true);return}}var f=this.C("script");f.id="cisc";if(this.type==="bs"||this.type==="loupan"){f.src=this.sugSrc+"?q="+encodeURIComponent(this.currentInput.value.trim())+"&c="+curCID}else{f.src=this.sugSrc+"?q="+encodeURIComponent(this.currentInput.value.trim())}this.JP.appendChild(f);this.vca.ci=this.currentInput.value}}else{if(this.currentInput.value.trim()==""){this.vca.kw="";this.SGV.style.display="none";return}if(this.changeif){this.JP.innerHTML="";d=this.jca.kw.length;if(d>100){this.jca.kw.splice(99)}for(e=0;e<d;e++){if(this.currentInput.value==this.jca.kw[e][0]){xxs(this.jca.kw[e],true);return}}f=this.C("script");f.id="kwsc";if(this.type==="bs"||this.type==="loupan"){f.src=this.sugSrc+"?q="+encodeURIComponent(this.currentInput.value.trim())+"&c="+curCID}else{f.src=this.sugSrc+"?q="+encodeURIComponent(this.currentInput.value.trim())}this.JP.appendChild(f);this.vca.kw=this.currentInput.value}}},pack:function(f){var h=this.C("div");h.innerHTML="\u60a8\u662f\u4e0d\u662f\u8981\u627e\uff1a";h.className="cai";h.onclick=function(a){a=a||window.event;if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}};this.SG.appendChild(h);var j=this;for(var i in f[1]){if(this.type==="loupan"&&f[1][i]==="g"){continue}var g=this.C("div");if(i.substring(0,2)==($(".curcity").length?$(".curcity").html():"")){i=i.substring(2)}g.innerHTML=i;g.className="nosel";g.onmouseover=function(){j.scn();this.className="sel"};g.onclick=function(a){a=a||window.event;if(a.stopPropagation){a.stopPropagation()}else{a.cancelBubble=true}if(j.currentInput){j.changeif=false;j.currentInput.value=this.innerHTML}if(j.nextInput){j.nextInput.focus()}j.SGV.style.display="none"};g.onmouseout=function(){j.scn()};if(f[1][i]=="normal"){this.SG.insertBefore(g,h)}else{this.SG.appendChild(g)}}if(!h.nextSibling){this.SG.removeChild(h)}if(this.SG.childNodes.length){this.SGV.style.display="block"}else{this.SGV.style.display="none"}},scn:function(){var d=this.SG.childNodes,f=d.length;for(var e=0;e<f;e++){if(d[e].className!="cai"){d[e].className="nosel"}}},swh:function(f,g){if(f.keyCode==13){this.SGV.style.display="none";if(this.nextInput){if(f.preventDefault){f.preventDefault()}else{f.returnValue=false}this.nextInput.focus()}}if(f.keyCode==38||f.keyCode==40){this.movs=false;this.changeif=false;if(this.SGV.style.display!="none"){var i=this.SG.childNodes,h=i.length;for(var j=0;j<h;j++){if(i[j].className=="sel"){this.selindex=j;break}}this.scn();if(f.keyCode==38){if(this.selindex==0){this.vca.hc=this.vca[g];this.currentInput.value=this.vca[g];this.selindex=-1}else{if(this.selindex==-1){this.selindex=h}if(i[this.selindex-1].className=="cai"&&this.selindex==1){this.vca.hc=this.vca[g];this.currentInput.value=this.vca[g];this.selindex=-1}else{if(i[this.selindex-1].className=="cai"){i[this.selindex-2].className="sel";this.vca.hc=i[this.selindex-2].innerHTML;this.currentInput.value=i[this.selindex-2].innerHTML}else{i[this.selindex-1].className="sel";this.vca.hc=i[this.selindex-1].innerHTML;this.currentInput.value=i[this.selindex-1].innerHTML}}}}else{if(f.keyCode==40){if(this.selindex==(h-1)){this.vca.hc=this.vca[g];this.currentInput.value=this.vca[g];this.selindex=-1}else{if(i[this.selindex+1].className=="cai"){i[this.selindex+2].className="sel";this.vca.hc=i[this.selindex+2].innerHTML;this.currentInput.value=i[this.selindex+2].innerHTML}else{i[this.selindex+1].className="sel";this.vca.hc=i[this.selindex+1].innerHTML;this.currentInput.value=i[this.selindex+1].innerHTML}}}}if(f.preventDefault){f.preventDefault();f.stopPropagation()}else{f.returnValue=false;f.cancelBubble=true}}}else{this.changeif=true}}};function xxs(d,c){pjsug.selindex=-1;pjsug.SG.innerHTML="";if(!c){pjsug.jca.kw.unshift(d)}pjsug.pack(d)}function area(d,c){pjsug.selindex=-1;pjsug.SG.innerHTML="";if(!c){pjsug.jca.ci.unshift(d)}pjsug.pack(d)}String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"")};
