/* Append File:leftTreeList */ var tempMaxBrandsCount = maxBrandsCount, tempMinBrandsCount = minBrandsCount, tempSeriesCount = seriesCount; var CookieHelper = { trim: function(b) { return (b || "").replace(/^\s+|\s+$/g, "") }, setCookie: function(b, d, a) { if (typeof d != "undefined") { a = a || {}; if (d === null) { d = ""; a.expires = -1 } var c = ""; if (a.expires && (typeof a.expires == "number" || a.expires.toUTCString)) { if (typeof a.expires == "number") { c = new Date; c.setTime(c.getTime() + a.expires * 24 * 60 * 60 * 1E3) } else c = a.expires; c = "; expires=" + c.toUTCString() } var e = a.path ? "; path=" + a.path : "", f = a.domain ? "; domain=" + a.domain : ""; a = a.secure ? "; secure" : ""; document.cookie = [b, "=", encodeURIComponent(d), c, e, f, a].join("") } }, readCookie: function(b) { var d = null; if (document.cookie && document.cookie != "") for (var a = document.cookie.split(";"), c = 0; c < a.length; c++) { var e = this.trim(a[c]); if (e.substring(0, b.length + 1) == b + "=") { d = decodeURIComponent(e.substring(b.length + 1)); break } } return d } } var LeftTree = LeftTree || {}; LeftTree.Tools = { getQueryString: function(data) { var tdata = ''; for (var key in data) { tdata += "&" + encodeURIComponent(key) + "=" + encodeURIComponent(data[key]); } tdata = tdata.replace(/^&/g, ""); return tdata }, addEvent: function(elm, type, fn, useCapture) { if (elm.addEventListener) { elm.addEventListener(type, fn, useCapture); return true; } else if (elm.attachEvent) { var r = elm.attachEvent('on' + type, fn); return r; } else { elm['on' + type] = fn; } }, MathWinHeigth: function() { var winH = 0; if (window.innerHeight) { winH = Math.min(window.innerHeight, document.documentElement.clientHeight); } else if (document.documentElement && document.documentElement.clientHeight) { winH = document.documentElement.clientHeight; } else if (document.body) { winH = document.body.clientHeight; } return winH; }, getElementByClassName: function(tagName, className) { var classObj = document.getElementsByTagName(tagName); var len = classObj.length; for (var i = 0; i < len; i++) { if (classObj[i].className == className) { return classObj[i]; break; } } }, attrStyle: function(elem, attr) { if (!elem) { return; } if (elem.style[attr]) { return elem.style[attr]; } else if (elem.currentStyle) { return elem.currentStyle[attr]; } else if (document.defaultView && document.defaultView.getComputedStyle) { attr = attr.replace(/([A-Z])/g, '-$1').toLowerCase(); return document.defaultView.getComputedStyle(elem, null).getPropertyValue(attr); } else { return null; } }, getOffsetTop: function(element) { var top = 0; while (element) { if (LeftTree.Tools.attrStyle(element, "position") === "fixed") { break; } top += element.offsetTop; element = element.offsetParent; } return top; } }; JsonpCallBack(); var IE6 = !!window.ActiveXObject && !window.XMLHttpRequest; function firstExpandMaster(masterRootLi) { if (masterContent == 'undefined') return; if (masterRootLi == null) return; masterRootLi.innerHTML += getBrandHtml(masterContent, params.tagtaype); } function treeHref(curLitterNum, o) { treeScroll(); var hideItemAllHeight = 0; for (var i = 1; i < curLitterNum; i++) { var hideItem = document.getElementById("letter" + i); if (!hideItem) continue; var hideItemHeight = hideItem.offsetHeight - 1; hideItemAllHeight += hideItemHeight; } var treeBox = document.getElementById("treev1"); //�� treeBox.scrollTop = hideItemAllHeight; //tree1�߶Ȳ������������¼���߶� if (treeBox.scrollTop < hideItemAllHeight) { var treeBottom = document.getElementById("tree-bottom"); treeBottom.style.height = parseInt(treeBottom.style.height) + (hideItemAllHeight - treeBox.scrollTop) + "px"; treeBox.scrollTop = hideItemAllHeight; } } function scrollTopFun(height) { treeScroll(); var hideItemAllHeight = height; var treeBox = document.getElementById("treev1"); //�� treeBox.scrollTop = hideItemAllHeight; //tree1�߶Ȳ������������¼���߶� if (treeBox.scrollTop < hideItemAllHeight) { var treeBottom = document.getElementById("tree-bottom"); treeBottom.style.height = parseInt(treeBottom.style.height) + (hideItemAllHeight - treeBox.scrollTop) + "px"; treeBox.scrollTop = hideItemAllHeight; } } //���㵱ǰ�ڵ㵽���ζ������� function MathCurrentTreeNodeTop(curNode) { var topHeight = 0; if (!curNode) return topHeight; while (curNode && curNode.id != "treev1") { topHeight += curNode.offsetTop; curNode = curNode.offsetParent; } return topHeight; } //������ָ��λ�� function scrollToCurrentTreeNode() { var currentNode = document.getElementById("curObjTreeNode"); var topHeight = MathCurrentTreeNodeTop(currentNode); var treeBox = document.getElementById("treev1"); //�� if (typeof CookieHelper == "undefined") { treeBox.scrollTop = topHeight; return; } var ScrollTreeNodeTop = CookieHelper.readCookie("ScrollTreeNodeTop"); var isMaster = 0; if (currentNode) { var child = currentNode.firstChild; if (child.className && child.className.indexOf("mainBrand") != -1) { isMaster = 1; } } else { ScrollTreeNodeTop = 0; } //��������Լ��ⲿ����������������� if (isMaster == 0 && /(mb_|b_|sb_|master|brand|serial)/gi.test(document.referrer) && document.referrer != "") { topHeight = parseInt(ScrollTreeNodeTop); } treeBox.scrollTop = topHeight; if (topHeight > parseInt(treeBox.scrollTop)) { var treeBottom = document.getElementById("tree-bottom"); treeBottom.style.height = parseInt(treeBottom.style.height) + (topHeight - parseInt(treeBox.scrollTop)) + "px"; treeBox.scrollTop = topHeight; } CookieHelper.setCookie("ScrollTreeNodeTop", parseInt(treeBox.scrollTop), { "expires": 360, "path": "/", "domain": "12365auto.com" }); } //��ȡ��ǰ�ڵ�������Ʒ�ƽڵ� function GetCurrentNodeMaster(curNode) { if (!curNode) { return null; } while (curNode) { var child = curNode.firstChild; if (child.className && child.className.indexOf("mainBrand") != -1) { break; } curNode = curNode.parentNode; } return curNode; } //���㵱ǰչ�������ĸ߶� function MathCurrentNodeMasterHeight(curNode) { var elemHeight = 0; if (!curNode) { return elemHeight; } while (curNode) { var child = curNode.firstChild; if (child.className && child.className.indexOf("mainBrand") != -1) { break; } curNode = curNode.parentNode; } elemHeight = curNode.offsetHeight; return elemHeight; } function treeBoxHeight() { var treeBox = document.getElementById("treev1"); //�� var winH; var topHeight = 0; var bodyClientHeight = document.documentElement.clientHeight; var treeSubNavv1Height = LeftTree.Tools.getElementByClassName("div", "treeSubNavv1"); var IFrameTomHeight = LeftTree.Tools.getElementByClassName("div", "treeNavv1"); var treev1 = document.getElementById("treev1"); var isIE6 = !!window.ActiveXObject && !window.XMLHttpRequest; if (treeBox == null) { return; } while (treeBox) { topHeight += treeBox.offsetTop; treeBox = treeBox.offsetParent; } winH = LeftTree.Tools.MathWinHeigth(); if (topHeight < 1) { topHeight = 0; } if (winH <= topHeight) { winH = topHeight; } if (treev1 != null && treev1.nodeType == 1) { var tree1Height = winH - topHeight; if (tree1Height < 1) { tree1Height = 0; } } //���θ߶� var leftTreeBox = document.getElementById("leftTreeBox"); var scrollTop = document.body.scrollTop || document.documentElement.scrollTop; var header = document.getElementById("header"); var headerTop = LeftTree.Tools.getOffsetTop(header); //��ȡ���������붥������ var headerHeight = LeftTree.Tools.attrStyle(header, "height"); //if (scrollTop >= (headerTop + headerHeight)) { scrollHeight += treeFixedNavHeight; } //fixed Ӱ������߶� var url = location.href; var leftTreeHeight = winH - headerTop + scrollTop; var treepx = 0; var pageTop = 235; var maxBid = $('#mxbid').val() || "0"; var id = 'x' + maxBid; if (url.indexOf("index") > -1) { var rightHeight = $(".cen_r3").height(); if(rightHeight<=667){ rightHeight=667; }else{ rightHeight = rightHeight-11; } leftTreeBox.style.height = rightHeight + "px"; treev1.style.height = rightHeight + "px"; var allCount = parseInt($('#dis_count').val()) || 0; if (allCount < 20) { $('#PageBox').hide(); } } else { leftTreeBox.style.height = leftTreeHeight - header.clientHeight - 3 + "px"; pageTop = 120; } var seriesNavH = $(".z_nav").outerHeight(true); var treelogin = $(".treelist-login").outerHeight(true); if (document.getElementById(id)) { setTimeout(function(){ scrollTopFun(MathCurrentTreeNodeTop(GetCurrentNodeMaster(document.getElementById(id).parentNode)) - pageTop - seriesNavH - treelogin); },200); var let = $("#" + id).parents("li[class=root]").find("b").text() || ""; if (let != "") { let = let.toLowerCase(); $(".t-" + let).find("a").addClass("pit"); } } } //���ݵ�����λ���������ξඥ�߶� function treeFixedNavTop() { var header = document.getElementById("header"); var headerTop = LeftTree.Tools.getOffsetTop(header); //��ȡ���������붥������ var headerHeight = header.offsetHeight; var scrollTop = document.body.scrollTop || document.documentElement.scrollTop; if (scrollTop >= (headerTop + parseInt(headerHeight))) { document.getElementById("leftTreeBox").style.top = 0 + "px"; return; } document.getElementById("leftTreeBox").style.top = headerTop + headerHeight - scrollTop + "px"; } //��������Ե����������� function MathScrollSettingTagBar() { window.setTimeout(function() { treeBoxHeight(); }, 250); //�������ĸ߶� treeFixedNavTop(); } //�������ε�����λ�������ĸ߶� function treeHeight() { if (!IE6) { MathScrollSettingTagBar(); } else { var leftTreeBox = document.getElementById("leftTreeBox"); var leftTreeHeight = LeftTree.Tools.getOffsetTop(leftTreeBox); setTimeout(function() { leftTreeBox.style.top = leftTreeHeight + ie6AdHeight + "px"; }, 500); } }; var ie6AdHeight = 0; function JsonpCallBack() { var jsonTree = brandsHaveSeries; var treeHtml = getTreeHtml(jsonTree); var treeBox = document.getElementById("leftTreeBox"); if (treeBox) treeBox.innerHTML = treeHtml; //��ǩ�䴫�ݲ��� scrollToCurrentTreeNode(); LeftTree.Tools.addEvent(window, "load", treeBoxHeight, false); LeftTree.Tools.addEvent(window, "resize", treeBoxHeight, false); //�������¼� var treeBox = document.getElementById("treev1"); LeftTree.Tools.addEvent(treeBox, "scroll", function() { if (typeof CookieHelper == "undefined") return; CookieHelper.setCookie("ScrollTreeNodeTop", parseInt(treeBox.scrollTop), { "expires": 360, "path": "/", "domain": "12365auto.com" }); }, false); //ҳ������¼� LeftTree.Tools.addEvent(window, "scroll", function() { if (!IE6) { //MathScrollSettingTagBar(); } else { var leftTreeBox = document.getElementById("leftTreeBox"); leftTreeBox.style.top = leftTreeBox + ie6AdHeight + "px"; //29:��½���߶� } }, false); treeHeight(); } //��ȡ�ַ�html function getCharNavHtml(charObj) { var html = "
"; return html; } function backMaxBrandCount(arr, a, j) { var _brandCoun = ""; var ii = ""; if (arr.length > 0) { var _tempArr = new Array(), _tempBrandArr = new Array(); _tempArr = arr.split("|"); for (i = 0; i < _tempArr.length; i++) { if (_tempArr[i] != "" && _tempArr[i] != undefined) { _tempBrandArr = _tempArr[i].split(","); if (_tempBrandArr[0] == a) { _brandCoun = _tempBrandArr[1]; } if (_brandCoun != '' && _brandCoun.length > 0) { if (j == "1") { tempMaxBrandsCount = tempMaxBrandsCount.replace("" + _tempBrandArr[0] + "," + _tempBrandArr[1] + "\|", ""); } else if (j == "2") { tempMinBrandsCount = tempMinBrandsCount.replace("" + _tempBrandArr[0] + "," + _tempBrandArr[1] + "\|", ""); } else if (j == "3") { tempSeriesCount = tempSeriesCount.replace("" + _tempBrandArr[0] + "," + _tempBrandArr[1] + "\|", ""); } break; } } } } return _brandCoun || "0"; } //��ȡ�����html function getTreeHtml(jsonTree) { var abcHaveBrands = { A: 1, B: 1, C: 1, D: 1, E: 0, F: 1, G: 1, H: 1, I: 0, J: 1, K: 1, L: 1, M: 1, N: 1, O: 1, P: 1, Q: 1, R: 1, S: 1, T: 1, U: 0, V: 0, W: 1, X: 1, Y: 1, Z: 1 }; if (abcHaveBrands == "undefined") return ""; var html = getCharNavHtml(abcHaveBrands); html += "
";// style=\"height:300px; overflow:hidden\" return html; } function treeScroll() { var maxbid = parseInt($('#mxbid').val()) || 0; var minbid = parseInt($('#mnbid').val()) || 0; var sid = parseInt($('#sid').val()) || 0; if (maxbid > 0) { $('#x' + maxbid).next().show(); if (maxbid > 0 && minbid <= 0 && sid <= 0) { $('#x' + maxbid).css("color", "#e97812"); } else if (minbid > 0 && sid <= 0) { $('#n' + minbid).css("color", "#e97812"); } else if (sid > 0) { $('#s' + sid).css("color", "#e97812"); } } }; function LetterNumber(letter) { switch (letter.toUpperCase()) { case "A": return 1; case "B": return 2; case "C": return 3; case "D": return 4; case "E": return 5; case "F": return 6; case "G": return 7; case "H": return 8; case "I": return 9; case "J": return 10; case "K": return 11; case "L": return 12; case "M": return 13; case "N": return 14; case "O": return 15; case "P": return 16; case "Q": return 17; case "R": return 18; case "S": return 19; case "T": return 20; case "U": return 21; case "V": return 22; case "W": return 23; case "X": return 24; case "Y": return 25; case "Z": return 26; } } /*! jQuery v1.8.3 jquery.com | jquery.org/license */ /* Append File:fordealermap */ var mp = new BMap.Map('allmap'); $(function() { var cityName = $.trim($('#cname').text()); var proName = $.trim($('#pname').text()); if (proName == "ȫ��") { mp.centerAndZoom("�й�", 6); } else if (!!cityName && cityName != "ȫ������") { mp.centerAndZoom(cityName, 10); } else { mp.centerAndZoom(proName, 9); } loadMap(); if (parseInt($('#sid').val()) > 0 || $.trim($('#search').val()) != "") { $('#leftTreeBox').hide(); $('#div_leftlt').show(); } var navigationControl = new BMap.NavigationControl({}); mp.addControl(navigationControl); mp.enableScrollWheelZoom(); $('.pbox_fore').hide(); $('.pbox_fore_nolink').hide(); }); //������ function loadMap() { ComplexCustomOverlay.prototype = new BMap.Overlay(); ComplexCustomOverlay.prototype.initialize = function(map) { var _id; this._map = map; var wtemp = 25; if (this._data.NewsID > 0) wtemp = 0; var div = $("
"); var that = this; var div1 = $("
"); var div2 = $("
" + CreateDivLayer(this._data) + "
"); div.append(div1); _id = this._data.id; map.getPanes().markerPane.appendChild(div[0]); div.append(div2); this._div = div; div1.click(function(event) { }); div2.find(".dealer-map-popbox-close").click(function() { div2.hide(); }); div.onmouseover = function() { this.style.zIndex = 1; } div.onmouseout = function() { this.style.zIndex = BMap.Overlay.getZIndex(that._point.lat); } return div[0]; } ComplexCustomOverlay.prototype.draw = function() { var map = this._map; var pixel = map.pointToOverlayPixel(this._point); this._div.css("left", pixel.x + "px"); this._div.css("top", pixel.y - 30 + "px"); } addPiont(); }; function div1click(obj, lat, lng) { $('#allmap [class=BMap_Marker]').each(function() { $(this).css("background", "url(/Images/jxs/dw.png)"); }) $(obj).css("background", "url(/Images/jxs/dw1.png)"); mp.panTo(new BMap.Point(lng, lat)); $(".dealer-map-popbox").each(function() { $(this).parent().css("z-index", 0); }); $(".dealer-map-popbox").hide(); $(obj).parent().css("z-index", 1); $(obj).next().show(); //event.stopPropagation(); //left $('#left_lt>div').each(function() { $(this).css("background", "none"); $(this).find('dt').children().removeClass('xz'); }) $('#dl' + $(obj).attr('id')).css("background", "#e5ecfd"); $('#dl' + $(obj).attr('id')).find('dt').children().addClass('xz'); $('#dl' + $(obj).attr('id')).addClass('fous'); } //var mp; function ComplexCustomOverlay(point, type, data) { this._point = point; this._type = type; this._data = data; } function addPiont() { if (typeof dealerData1 != "undefined" && dealerData1 != "") { if (typeof dealerData1 == "string") { dealerData1 = eval("(" + dealerData1 + ")"); } for (var i = 0; i < dealerData1.length; i++) { var point = new BMap.Point(dealerData1[i].lng, dealerData1[i].lat); mp.addOverlay(new ComplexCustomOverlay(point, "", dealerData1[i])); } } } //���������� function CreateDivLayer(data) { var _MainBrand = decodeURIComponent(data.bands) var dealerHtml = "
" + "
" + " " + "

" + ""+data.score2+"��" + "

"; dealerHtml += "

Ʒ�ƣ�" + autoAddEllipsis(_MainBrand, 25) + "

" + "

" + " ��ַ��" + autoAddEllipsis(decodeURIComponent(data.address), 23) + "" + "

" + "

" + " �绰��" + decodeURIComponent(data.telephone) + "" + "

" + "
" + "
" + "
" + "
" + "
" + "
" + "
"; return dealerHtml; } function autoAddEllipsis(e, t) { var n = cutString(e, t), r = n.cutflag, i = n.cutstring; return "1" == r ? i + "..." : i } function cutString(e, t) { var n = e.length, r, i, s = "1", o = 0, u = !1; n <= t / 2 && (i = e, u = !0); if (!u) for (var a = 0; a < n; a++) { isFull(e.charAt(a)) ? o += 2 : o += 1; if (o > t) { i = e.substring(0, a), u = !0; break } if (o == t) { i = e.substring(0, a + 1), u = !0; break } } return u || (i = e, u = !0), i.length == n && (s = "0"), { cutstring: i, cutflag: s} } function isFull(e) { for (var t = 0; t < e.strLen; t++) return e.charCodeAt(t) > 128 ? !0 : !1 } function mousedj(obj, id, lng, lat) { $('#left_lt>div').each(function() { $(this).removeClass('fous'); }) div1click($('#' + id), lat, lng); $(obj).addClass('fous'); $(obj).find('dt').children().addClass('xz'); } function changbgover(obj) { $(obj).css("background", "#e5ecfd"); $(obj).find('dt').children().addClass('xz'); $('#' + $(obj).attr('id').replace("dl", "")).css("background", "url(/Images/jxs/dw1.png)"); } function changbgmove(obj) { $('#left_lt>div').each(function() { if ($(this).attr('class') != "list_con fous") { $(this).css("background", "none"); $(this).find('dt').children().removeClass('xz'); } }) $('#' + $(obj).attr('id').replace("dl", "")).css("background", "url(/Images/jxs/dw1.png)"); if ($(obj).attr('class') != "list_con fous") { $('#' + $(obj).attr('id').replace("dl", "")).css("background", "url(/Images/jxs/dw.png)"); } } var _mxbid = $('#mxbid').val(); var _mnbid = $('#mnbid').val(); var _sid = $('#sid').val(); var _pid = $('#pid').val(); var _cid = $('#cid').val(); if (parseInt($('#mxbid').val()) > 0) { $('#x' + _mxbid).next().toggle(); if (parseInt(_mnbid) > 0) { $('.xzcx').append(" " + $('#n' + _mnbid).children().eq(0).text() + ""); } else if (parseInt($('#sid').val()) > 0) { $('.xzcx').append(" " + $('#s' + _sid).children().eq(0).text() + ""); } else { $('.xzcx').append(" " + $('#x' + _mxbid).children().eq(0).text() + ""); } } if (_mxbid > 0 && _mnbid <= 0 && _sid <= 0) { $('#x' + _mxbid).css("color", "red"); } else if (_mnbid > 0 && _sid <= 0) { $('#n' + _mnbid).css("color", "red"); } else if (_sid > 0) { $('#s' + _sid).css("color", "red"); } $("#fpro").hover(function() { $("#prove").show(); $(this).css("cursor", "pointer"); }, function() { $("#prove").hide(); }); $("#fcity").hover(function() { $("#city").show(); $(this).css("cursor", "pointer"); }, function() { $("#city").hide(); }); $('#closeLeft').click(function() { $('#leftTreeBox').show(); $('#div_leftlt').hide(); })