/* 从js文件夹下拷贝过来,优化品牌页使用 此js文件是品牌,厂商,系列页,及有右侧推荐经销商的页面使用的 目前仅有新优化的品牌页和厂商页在使用此脚本文件,随着以后页面的优化,其他面也使用此脚本,最后可以将js文件夹下的同名文件删除 */ var codetime; //动态获取推荐经销商code function callcode(id, url, parms) { codetime = window.setInterval(fixcode, 200); window.setTimeout(fixcode, 60000); $.ajax({ url: url, type: "GET", data: "ModuleId=" + id + parms + "&date=" + encodeURIComponent(new Date().getTime().toString()), success: function(data) { $("#div_dealer").val(data); //loadScript("/script/gsn/gsn.js", null); } }); } //调整推荐经销商code function fixcode() { if ($("#div_dealer").val() != "") { if ($("#" + divid) == null) { return false; } if ($("#" + divid).html() == null) { return false; } if ($("#" + divid).html().indexOf("CScuntent2rightinfo1") > 0) { clearInterval(codetime); return false; } $("#" + divid).append($("#div_dealer").val()); clearInterval(codetime); if ($("#" + groupid).html().indexOf("CScuntent2rightinfo1") > 0) { $("#" + groupid).show(); if ($(".CScuntent2rightinfo1") != "undefined" && $(".CScuntent2rightinfo1").length > 0) { var jxsndiv = "
"; var jxsbg = "background"; var jxsbg1 = "#ABCFFD"; var jxsbg2 = "#EAEAEA"; var jxsbg3 = "#FFE957"; $(".CScuntent2rightinfo2").width(228); if ($.browser.msie) { $(".CScuntent2rightinfo1").css({ "width": "222px", "height": "102px" }).wrap(""); } else { $(".CScuntent2rightinfo1").css({ "width": "222px", "height": "102px", "margin-left": "3px" }).wrap(""); } $(".CScuntent2rightinfo1").parent().css(jxsbg, jxsbg3); $(".jsx_z").parent().css(jxsbg, jxsbg1); $(".jsx_b").parent().css(jxsbg, jxsbg2); $(".jsx_z:first,.jsx_b:first,.CScuntent2rightinfo1[class$='fo1']:first").parent().before(jxsndiv); $(".jsx_z:last,.jsx_b:last,.CScuntent2rightinfo1[class$='fo1']:last").parent().after(jxsndiv); $(".jsx_z:first").parent().prev().css(jxsbg, jxsbg1); $(".jsx_z:last").parent().next().css(jxsbg, jxsbg1); $(".jsx_b:first").parent().prev().css(jxsbg, jxsbg2); $(".jsx_b:last").parent().next().css(jxsbg, jxsbg2); $(".CScuntent2rightinfo1[class$='fo1']:first").parent().prev().css(jxsbg, jxsbg3); $(".CScuntent2rightinfo1[class$='fo1']:last").parent().next().css(jxsbg, jxsbg3); $(".jsx_z").find(".CScuntent2rightinfo11[class$='fo11']").addClass("posRelative"); $(".jsx_z .posRelative>a").before(""); addStyle(".LPflod{background-image:url('http://images.webcars.com.cn/mainweb/Img/changshang/FDkuang.png'); background-repeat: no-repeat;display:none;height:175px;position:absolute;right:116px;top:-40px;width:228px;behavior: url('/js/iepngfix.htc')"); } } else { $("#" + groupid).hide(); } } } //添加页面样式 function addStyle(content) { var style; if (document.all) //IE { style = document.createStyleSheet(); style.cssText = content; } else { style = document.createElement("style"); style.type = "text/css"; //style.innerHTML = content;//Safari、Chrome 下innerHTML只读 style.textContent = content; } try { document.getElementsByTagName("head")[0].appendChild(style); } catch (e) { } //IE Error:不支持此接口 }