var decodeURIComponentEx = function (uriComponent) { if (!uriComponent) { return uriComponent; } var ret; try { ret = decodeURIComponent(uriComponent); } catch (ex) { ret = unescape(uriComponent); } return ret; }; (function (e, f, b) { var d = /\+/g; function g(j) { return j } function h(j) { return c(decodeURIComponentEx(j.replace(d, " "))) } function c(j) { if (j.indexOf('"') === 0) { j = j.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\") } return j } function i(j) { return a.json ? JSON.parse(j) : j } var a = e.cookie = function (r, q, w) { if (q !== b) { w = e.extend({}, a.defaults, w); if (q === null) { w.expires = -1 } if (typeof w.expires === "number") { var s = w.expires, v = w.expires = new Date(); v.setDate(v.getDate() + s) } q = a.json ? JSON.stringify(q) : String(q); return (f.cookie = [encodeURIComponent(r), "=", a.raw ? q : encodeURIComponent(q), w.expires ? "; expires=" + w.expires.toUTCString() : "", w.path ? "; path=" + w.path : "", w.domain ? "; domain=" + w.domain : "", w.secure ? "; secure" : ""].join("")) } var j = a.raw ? g : h; var u = f.cookie.split("; "); var x = r ? null : {}; for (var p = 0, n = u.length; p < n; p++) { var o = u[p].split("="); var k = j(o.shift()); var m = j(o.join("=")); if (r && r === k) { x = i(m); break } if (!r) { x[k] = i(m) } } return x }; a.defaults = {}; e.removeCookie = function (k, j) { if (e.cookie(k) !== null) { e.cookie(k, null, j); return true } return false } })(jQuery, document); jQuery.fn.pagination=function(a,b){b=jQuery.extend({items_per_page:10,num_display_entries:10,current_page:0,num_edge_entries:0,link_to:"#",prev_text:"Prev",next_text:"Next",ellipse_text:"...",prev_show_always:true,next_show_always:true,callback:function(){return false}},b||{});return this.each(function(){function f(){return Math.ceil(a/b.items_per_page)}function h(){var k=Math.ceil(b.num_display_entries/2);var l=f();var j=l-b.num_display_entries;var m=g>k?Math.max(Math.min(g-k,j),0):0;var i=g>k?Math.min(g+k,l):Math.min(b.num_display_entries,l);return[m,i]}function e(j,i){g=j;c();var k=b.callback(j,d);if(!k){if(i.stopPropagation){i.stopPropagation()}else{i.cancelBubble=true}}return k}function c(){d.empty();var k=h();var o=f();var p=function(i){return function(q){return e(i,q)}};var n=function(i,q){i=i<0?0:(i"+(q.text)+"")}else{var r=jQuery(""+(q.text)+"").bind("click",p(i)).attr("href",b.link_to.replace(/__id__/,i))}if(q.classes){r.addClass(q.classes)}d.append(r)};if(b.prev_text&&(g>0||b.prev_show_always)){n(g-1,{text:b.prev_text,classes:"prev"})}if(k[0]>0&&b.num_edge_entries>0){var j=Math.min(b.num_edge_entries,k[0]);for(var l=0;l"+b.ellipse_text+"").appendTo(d)}}for(var l=k[0];l0){if(o-b.num_edge_entries>k[1]&&b.ellipse_text){jQuery(""+b.ellipse_text+"").appendTo(d)}var m=Math.max(o-b.num_edge_entries,k[1]);for(var l=m;l0){e(g-1);return true}else{return false}};this.nextPage=function(){if(g0){ $.each(d,function(g,r) { var f=new BMap.Icon(marker_icon_url,new BMap.Size(23,25),{anchor:new BMap.Size(10,25),imageOffset:new BMap.Size(0,0-a*25) }); var n = new BMap.Point(r.x, r.y); var h = new BMap.Marker(n,{icon: f}); map.addOverlay(h); var q = $("
"); var l = $("
"+r.name+(r["is_vip"]?'V':'')+"
"); var i = r.joblist; var p = ""; for (var v in i) { p+="
"+i[v]["name"]+"
" } p+="
更多…
"; var t = $(p); q.append(l); q.append(t); q = q[0]; var k = {message:r.name,enableCloseOnClick:false}; var u = new BMap.InfoWindow(q, k); u.addEventListener("clickclose", function() { _current_iw = null }); h.addEventListener("click", function() { _current_iw = r.id; this.openInfoWindow(u); radius() }); if(type=='company'){ var m = $("
"); var html = ''; html += '
'; html += ''+r.name+''; if(i && i.length>0){ for (var v in i) { html += '
'; html += ''+i[v]['name']+''; html += '
'; html += ''+i[v]['job_salary']+''; if(i[v]['job_exp']!=''){ html += '|'+i[v]['job_exp']+'经验'; } if(i[v]['job_edu']!=''){ html += '|'+i[v]['job_edu']+'学历'; } html += '
'; html += '查看' html += '
'; } }else{ html += '
暂无职位
'; } html += '
'; m.append(html); }else{ var m = $("
"); var html = ''; html += '
'; html += ''+i[0]['name']+''; html += '
'; html += '
'; html += ''+i[0]['job_salary']+''; if(i[0]['job_exp']!=''){ html += '|'+i[0]['job_exp']+'经验'; } if(i[0]['job_edu']!=''){ html += '|'+i[0]['job_edu']+'学历'; } html += '
'; html += '
'; html += ''+r.name+''; html += '
'; var wfarr = i[0]['welfare_n']; for (var wf in wfarr) { if(wfarr[wf].trim()!=''){ html += ''+wfarr[wf]+''; } } html += '查看' m.append(html); } b.append(m); h.addEventListener("mouseover",function(w) { m.css("background-color","#fff"); }); h.addEventListener("mouseout",function() { m.css("background-color","#f8f8f8"); }); m.click(function(w) { if(w.target.tagName!="a" && w.target.tagName!="A"){ _current_iw = r.id; h.openInfoWindow(u); radius(); } }); m.hover(function(w) { h.setIcon(BlueIcon); h.setZIndex(MarkerIndex++); m.css("background-color","#fff"); },function(w) { h.setIcon(f); m.css("background-color","#f8f8f8"); }); if(c){ map.centerAndZoom(n,13); c=false; } if(_current_iw==r.id){ h.openInfoWindow(u); } a++; }) }else{ var pagetype = type=='company'?'企业':'职位'; b.append('
附近暂无'+pagetype+'
'); } } function updatePageByKeyword(a) { $("#Pagination").pagination(a, { callback:callbackKeyword, prev_text:" ", next_text:" ", items_per_page:10, num_edge_entries:1, num_display_entries:3, link_to: "javascript:;" }) } function callbackKeyword(a, b){ searchByKeyword(a, false) } function updatePageByLocation(a){ $("#Pagination").pagination(a,{ callback: callbackLocation, prev_text: " ", next_text: " ", items_per_page: 10, num_edge_entries: 1, num_display_entries: 3, link_to: "javascript:;" }) } function callbackLocation(a,b){ searchByLocation(a, false) } function updatePageWhenMoving(a){ $("#Pagination").pagination(a,{ callback: callbackWhenMoving, prev_text: " ", next_text: " ", items_per_page:10, num_edge_entries: 1, num_display_entries: 3, link_to: "javascript:;" }) } function callbackWhenMoving(a,b){ searchWhenMoving(a,false); } function radius(){ $(".BMap_top").next().children().css("border-top-right-radius","10px 10px"); $(".BMap_top").prev().children().css("border-top-left-radius","10px 10px"); $(".BMap_bottom").next().children().css("border-bottom-right-radius","10px 10px"); $(".BMap_bottom").prev().children().css("border-bottom-left-radius","10px 10px"); } function get_current_loaction(page) { var geolocation = new BMap.Geolocation(); geolocation.getCurrentPosition(function (r) { if (this.getStatus() == BMAP_STATUS_SUCCESS) { location_r = r; var point = new BMap.Point(r.point.lng,r.point.lat); map.centerAndZoom(point,13); var k=map.getBounds(); var a=k.getSouthWest(); var d=k.getNorthEast(); var t=$('#searchtype').val(); get_data_map('',a.lng,d.lng,a.lat,d.lat,page,true,2,t); } else { } }, { enableHighAccuracy: true }); } $(document).ready(function() { $('.changetype').click(function(){ var type = $(this).attr('data-type'); $('#keyword').val(''); $('#searchtype').val(type); $('#t'+type).addClass('new_mapbox_nav_cur'); if(type=='job'){ $('#tcompany').removeClass('new_mapbox_nav_cur'); $("#keyword").attr("placeholder","请输入职位名称"); }else{ $('#tjob').removeClass('new_mapbox_nav_cur'); $("#keyword").attr("placeholder","请输入企业名称"); } searchByKeyword(0,true) }); $("#keyword").keydown(function(a) { if(a.keyCode==13){ searchByKeyword(0,true) } }); $("#submitbutton").click(function() { searchByKeyword(0,true) }); $("#search .hot a").click(function() { $("#map .map-loader").show(); var a = $(this).html(); a.trim(); $("#keyword").val(a); $("#title a").attr("class", "nselect"); var b = $("#title i"); b.detach(); $("#title a[title=job]").attr("class", "select").append(b); $("#searchtype").val("job"); searchByKeyword(0,true) }); if(map_tocity==1){ get_current_loaction(0) }else{ map.centerAndZoom(point,14); var k=map.getBounds(); var a=k.getSouthWest(); var d=k.getNorthEast(); var t=$('#searchtype').val(); get_data_map('',a.lng,d.lng,a.lat,d.lat,0,true,2,t); } });