function rightSide() { this.Decrypt2 = function(data) { var b = (7 * (data - 6) % 10 + 10) % 10; return b.toString(); } this.Decrypt = function(playerID) { playerID = playerID.toString(); var arrID = new Array(); for (var i = 0; i < playerID.length; i = i + 1) { var a = playerID.substr(i, 1); switch (a) { case "0": arrID.push(this.Decrypt2(0)); break; case "4": arrID.push(this.Decrypt2(1)); break; case "5": arrID.push(this.Decrypt2(2)); break; case "3": arrID.push(this.Decrypt2(3)); break; case "6": arrID.push(this.Decrypt2(4)); break; case "9": arrID.push(this.Decrypt2(5)); break; case "7": arrID.push(this.Decrypt2(6)); break; case "1": arrID.push(this.Decrypt2(7)); break; case "2": arrID.push(this.Decrypt2(8)); break; case "8": arrID.push(this.Decrypt2(9)); break; } } return arrID.join(''); } // //守门员 // this.ShowGoalkeeper = function() { // var arrHtml1 = new Array(); // arrHtml1.push("
Goalkeeper
"); // arrHtml1.push(""); // for (var i = 0; i < goalkeeper.length; i++) { // var oneRecord = goalkeeper[i]; // arrHtml1.push(""); // } // arrHtml1.push("
" + oneRecord[1] + "" + ShowCaptain(oneRecord) + "" + oneRecord[2 + lang] + "
"); // return arrHtml1.join(''); // } // //后卫 // this.ShowRearguard = function() { // var arrHtml1 = new Array(); // arrHtml1.push("
Defender
"); // arrHtml1.push(""); // for (var i = 0; i < rearguard.length; i++) { // var oneRecord = rearguard[i]; // arrHtml1.push("") // } // arrHtml1.push("
" + oneRecord[1] + "" + ShowCaptain(oneRecord) + "" + oneRecord[2 + lang] + "
"); // return arrHtml1.join(''); // } // //中场 // this.ShowMidfielder = function() { // var arrHtml1 = new Array(); // arrHtml1.push("
Midfielder
"); // arrHtml1.push(""); // for (var i = 0; i < midfielder.length; i++) { // var oneRecord = midfielder[i]; // arrHtml1.push("") // } // arrHtml1.push("
" + oneRecord[1] + "" + ShowCaptain(oneRecord) + "" + oneRecord[2 + lang] + "
"); // return arrHtml1.join(''); // } // //前锋 // this.ShowVanguard = function() { // var arrHtml1 = new Array(); // arrHtml1.push("
Striker
"); // arrHtml1.push(""); // for (var i = 0; i < vanguard.length; i++) { // var oneRecord = vanguard[i]; // arrHtml1.push("") // } // arrHtml1.push("
" + oneRecord[1] + "" + ShowCaptain(oneRecord) + "" + oneRecord[2 + lang] + "
"); // return arrHtml1.join(''); // } // //转会:转出 // this.ShowTurnOut = function() { // var arrHtml1 = new Array(); // arrHtml1.push("
Departure
"); // arrHtml1.push(""); // arrHtml1.push(""); // arrHtml1.push("
 No Information
"); // return arrHtml1.join(''); // } // //转会:转入 // this.ShowTurnIn = function() { // var arrHtml1 = new Array(); // arrHtml1.push("
Join in
"); // arrHtml1.push(""); // arrHtml1.push(""); // arrHtml1.push("
 No Information
"); // return arrHtml1.join(''); // } // function ShowCaptain(oneRecord) { // if (Object.prototype.toString.call(oneRecord) !== '[object Array]' || oneRecord.length < 6) { // return ''; // } // var imageUlr = "/images/" // switch (oneRecord[5]) { // case 1: return 'captain'; break; // case 5: return 'vicecaptain'; break; // } // return ''; // } // //document.getElementById("i_right").innerHTML = "
" + this.ShowGoalkeeper() + this.ShowRearguard() + this.ShowMidfielder() + this.ShowVanguard() + this.ShowTurnOut() + this.ShowTurnIn() + "
"; } //头部信息 function mainTitle(teamDetail) { var ri = new rightSide(); var coachID = 0, coachName = ""; if (window.coach && window.coach.length) { coachID = ri.Decrypt(coach[0][0]); coachName = coach[0][2] || coach[0][4]; } var mainDiv = document.getElementById("mainTitle"); var address = teamDetail[15] && !/[\u4E00-\u9FA5]/.test(teamDetail[15]) ? teamDetail[15] : "";//忽略中文 var coachUrl = teamDetail[13]; //修正部分不是http开头的网址 if (coachUrl !== null && coachUrl.indexOf("www") == 0) { coachUrl = "//" + coachUrl; } mainDiv.innerHTML = _$("tplMainTitle").innerHTML.format( /*0*/(teamDetail[4] == "" ? _teamIcon : changeGif("/Image/team/" + teamDetail[4]) + "?" + Math.floor(Math.random() * 10)), /*1*/teamDetail[3] == "" ? teamDetail[2] : teamDetail[3], /*2*/_moduleKey == 'thai' || _moduleKey == 'vn' ? teamDetail[2] : "", /*3*/handleEmpty(teamDetail[7]), /*4*/handleEmpty(teamDetail[10]), /*5*/handleEmpty(teamDetail[11]), /*6*/handleEmpty(dateToTime(teamDetail[12])), /*7*/"", /*8*/(coachID == 0 ? handleEmpty(coachName) : "" + handleEmpty(coachName) + ""), /*9*/coachUrl, /*10*/!teamDetail[13] ? "hide" : "", /*11*/handleEmpty(address)); try { if (typeof (forLoc) != "undefined" && forLoc) { var indItem = document.getElementById("introduce1"); if (indItem && teamDetail[14] != "") indItem.innerHTML = teamDetail[14]; //把不需要显示球队简介的id给去掉则抛出异常 else { if (document.getElementById("introduce_div")) document.getElementById("introduce_div").style.display = "none"; } } else { var indItem = document.getElementById("introduce"); if(indItem) indItem.style.display = "none"; } guiderBar(); } catch (e) { } //初始化关注图标 if (Config.getFavTeamIds().indexOf(teamDetail[0].toString()) != -1) { $("#favTeamIcon").addClass("on"); $("#favTeamIcon").html(_locModel.T.T_Btn_Following + ""); }; } function guiderBar() { if (!_$("guiderBarList")) return; var html = new Array(); html.push(getGuiderLi("/", _locModel.T.T_Database)); if (typeof (arrLeague) != "undefined" && arrLeague[0]) { if (arrLeague[0] == 91) html.push(getGuiderLi("/fifa.html", arrLeague[3], 1)); //国家队转到世界排名页面 else html.push(getGuiderLi("/leagueinfo/" + arrLeague[0] + ".html", arrLeague[3], 1)); } document.getElementById('guiderBarList').innerHTML = html.join(''); } function getGuiderLi(link, title, lastf) { return [ '
  • ', '', title == '' ? '' : '' + title + '', '
  • ' ].join(''); } function handleEmpty(str) { if (CheckEmpty(str)) { return "-"; } else { return str; } }; function ShowLeaScore() { this.showHtml = function(name, oneRecord) { var ss = "" + name + "" + oneRecord[0] + "" + oneRecord[1] + "" + oneRecord[2] + "" + oneRecord[3] + "" + oneRecord[4] + "" + oneRecord[5] + "" + oneRecord[6] + "" + oneRecord[7] + "%" + oneRecord[8] + "%" + oneRecord[9] + "%" + oneRecord[10] + "" + oneRecord[11] + "" + oneRecord[12] + ""; return ss; } var arrHtml = new Array(); var tableHtml = ""; arrHtml.push(tableHtml); arrHtml.push(_$("tplFull").innerHTML); //总积分的扣分 leagueData[2][12] = leagueData[2][12] - leagueData[6]; arrHtml.push(this.showHtml(_locModel.T.T_Total, leagueData[2])); arrHtml.push(this.showHtml(_locModel.T.T_Home, leagueData[0])); arrHtml.push(this.showHtml(_locModel.T.T_Away, leagueData[1])); arrHtml.push(""); _$("full_ft").innerHTML = arrHtml.join(""); //半场积分 arrHtml = new Array(); arrHtml.push(tableHtml); arrHtml.push(_$("tplFull").innerHTML); arrHtml.push(this.showHtml(_locModel.T.T_Total, leagueData[5])); arrHtml.push(this.showHtml(_locModel.T.T_Home, leagueData[3])); arrHtml.push(this.showHtml(_locModel.T.T_Away, leagueData[4])); arrHtml.push(""); _$("full_ht").innerHTML = arrHtml.join(""); } //让球---------------- function ShowLeaLetGoal() { this.showHtml = function(name, panLu) { var ss = "" + name + "" + panLu[2] + "" + panLu[3] + "" + panLu[4] + "" + panLu[5] + "" + panLu[6] + "" + panLu[7] + "" + panLu[8] + "" + panLu[9] + "" + panLu[10] + "%" + panLu[11] + "%" + panLu[12] + "%" + panLu[0] + ""; return ss; } this.findTeam = function(TeamID, arrPanLu) { for (var i = 0; i < arrPanLu.length; i++) { var oneRe = arrPanLu[i]; if (TeamID == oneRe[1]) { return oneRe; } } return null; } var arrHtml = new Array(); var tableHtml = ""; arrHtml.push(tableHtml); arrHtml.push(_$("tplLetgoal").innerHTML); //总积分的扣分 var ttPanlu = typeof (TotalPanLu) != "undefined" ? this.findTeam(teamDetail[0], TotalPanLu) : null; var hPanlu = typeof (HomePanLu) != "undefined" ? this.findTeam(teamDetail[0], HomePanLu) : null; var gPanlu = typeof (GuestPanLu) != "undefined" ? this.findTeam(teamDetail[0], GuestPanLu) : null; if (ttPanlu != null && hPanlu != null && gPanlu != null) { arrHtml.push(this.showHtml(_locModel.T.T_Total, ttPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Home, hPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Away, gPanlu)); } else { arrHtml.push(""); } arrHtml.push(""); _$("lg_ft").innerHTML = arrHtml.join(""); //半场积分 arrHtml = new Array(); arrHtml.push(tableHtml); arrHtml.push(_$("tplLetgoal").innerHTML); var tthPanlu = typeof (TotalHalfPanLu) != "undefined" ? this.findTeam(teamDetail[0], TotalHalfPanLu) : null; var hhPanlu = typeof (HomeHalfPanLu) != "undefined" ? this.findTeam(teamDetail[0], HomeHalfPanLu) : null; var ghPanlu = typeof (GuestHalfPanLu) != "undefined" ? this.findTeam(teamDetail[0], GuestHalfPanLu) : null; if (tthPanlu != null && hhPanlu != null && ghPanlu != null) { arrHtml.push(this.showHtml(_locModel.T.T_Total, tthPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Home, hhPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Away, ghPanlu)); } else { arrHtml.push("" + _locModel.T.T_NoData + ""); } arrHtml.push(""); _$("lg_ht").innerHTML = arrHtml.join(""); } //大小球---------------- function ShowBigSmall() { this.showHtml = function(name, panLu) { var ss = "" + name + "" + panLu[2] + "" + panLu[3] + "" + panLu[4] + "" + panLu[5] + "" + panLu[6] + "" + panLu[7] + "" + panLu[8] + "" + panLu[0] + ""; return ss; } this.findTeam = function(TeamID, arrPanLu) { for (var i = 0; i < arrPanLu.length; i++) { var oneRe = arrPanLu[i]; if (TeamID == oneRe[1]) { return oneRe; } } return null; } var arrHtml = new Array(); var tableHtml = ""; arrHtml.push(tableHtml); arrHtml.push(_$("tplOu").innerHTML); //总积分的扣分 var ttPanlu = typeof (TotalBs) != "undefined" ? this.findTeam(teamDetail[0], TotalBs) : null; var hPanlu = typeof (HomeBs) != "undefined" ? this.findTeam(teamDetail[0], HomeBs) : null; var gPanlu = typeof (GuestBs) != "undefined" ? this.findTeam(teamDetail[0], GuestBs) : null; if (ttPanlu != null && hPanlu != null && gPanlu != null) { arrHtml.push(this.showHtml(_locModel.T.T_Total, ttPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Home, hPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Away, gPanlu)); } else { arrHtml.push(""); } arrHtml.push(""); _$("ou_ft").innerHTML = arrHtml.join(""); //半场积分 arrHtml = new Array(); arrHtml.push(tableHtml); arrHtml.push(_$("tplOu").innerHTML); var tthPanlu = typeof (TotalBsHalf) != "undefined" ? this.findTeam(teamDetail[0], TotalBsHalf) : null; var hhPanlu = typeof (HomeBsHalf) != "undefined" ? this.findTeam(teamDetail[0], HomeBsHalf) : null; var ghPanlu = typeof (GuestBsHalf) != "undefined" ? this.findTeam(teamDetail[0], GuestBsHalf) : null; if (tthPanlu != null && hhPanlu != null && ghPanlu != null) { arrHtml.push(this.showHtml(_locModel.T.T_Total, tthPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Home, hhPanlu)); arrHtml.push(this.showHtml(_locModel.T.T_Away, ghPanlu)); } else { arrHtml.push("" + _locModel.T.T_NoData + ""); } arrHtml.push(""); _$("ou_ht").innerHTML = arrHtml.join(""); } function Team_SelectLogic(selectDom) { this.dom = selectDom; this.Show = function (SelectTeamID) { this.dom.options[0] = new Option(_locModel.T.T_SelectTeam); var htmlArray = new Array(); for (var i = 0; i < arrTeam.length; i++) { var oneRecord = arrTeam[i]; this.dom.options[this.dom.length] = new Option(oneRecord[1 + lang], oneRecord[0]); } } this.Change = function () { var value = this.dom.value; var url = document.URL; var rg; var ul = ""; //if (url.indexOf(".html") != -1) { // rg = /\/team\/(\w+)/ //} //else { // rg = /(\w{1,15})\.aspx/; //} //var murl = url.match(rg); window.location.href = value; } } function TechLogic() { this.selSclassID = 0; this.scheduleTechIndex = 1; this.scheduleTechLength = 20; this.maxShowLength = 0; var mathHelp = new MathHelp(); var selectSclassID = "selectSclass"; var tableID_Sclass = "Tech_sclass"; var tableID_Honor = "honorTable"; var tableID_schedule = "Tech_schedule" this.Show = function () { if (typeof (forLoc) != "undefined" && forLoc) { this.ShowHonor(tableID_Honor); this.ShowSchedule(tableID_schedule); this.ShowSclass(tableID_Sclass); } } this.ShowSclass = function (tableID) { if (countSum == null) return; var htmlArray = new Array(); var htmlSelectArray = new Array(); var selectDom = document.getElementById(selectSclassID); htmlArray.push(''); htmlArray.push(_$("tplOffensive").innerHTML); for (var i = 0; i < countSum.length; i++) { var oneData = countSum[i]; selectDom.options[selectDom.length] = new Option(oneData[1].split('^')[dataLang].replace("All", _locModel.T.T_All), oneData[0]); htmlSelectArray.push(' '); htmlArray.push(' ' + '' + ''); } htmlArray.push(''); document.getElementById(tableID).innerHTML = htmlArray.join(''); var obj = this; selectDom.onchange = function () { ChangeSelectSclass(selectDom, obj); } } var ChangeSelectSclass = function (selectDom, obj) { obj.selSclassID = parseInt(selectDom.value); var trArr = $("tr[sclassID]", document.getElementById(tableID_Sclass)); for (var i = 0; i < trArr.length; i++) { var onetr = trArr[i]; var tempSclassID = onetr.getAttribute("sclassID"); if (tempSclassID == obj.selSclassID) { onetr.style.display = ""; } else onetr.style.display = "none"; } trArr = $("tr[sclassID]", document.getElementById(tableID_schedule)); var showCount = new Array(); for (var i = 0; i < trArr.length; i++) { var onetr = trArr[i]; var tempSclassID = onetr.getAttribute("sclassID"); if (obj.selSclassID == 0 || tempSclassID == obj.selSclassID) { showCount.push(onetr); } else onetr.style.display = "none"; } obj.maxShowLength = showCount.length; var pageCount = parseInt(obj.maxShowLength / obj.scheduleTechLength) + 1; if (obj.scheduleTechIndex > pageCount) obj.scheduleTechIndex = pageCount; for (var i = 0; i < showCount.length; i++) { var onetr = showCount[i]; if (i >= (obj.scheduleTechIndex - 1) * obj.scheduleTechLength && i < obj.scheduleTechIndex * obj.scheduleTechLength) onetr.style.display = ""; else onetr.style.display = "none"; } ShowPage(obj.scheduleTechIndex, pageCount); } this.ShowHonor = function (tableID) { if (teamHonor == null || !teamHonor.length) { if (document.getElementById("honor_div")) { document.getElementById("honor_div").style.display = "none"; } return; } var htmlArray = new Array(); htmlArray.push(''); htmlArray.push(_$("tplHonor").innerHTML); for (var i = 0; i < teamHonor.length; i++) { var oneData = teamHonor[i]; var honorArr = oneData[1].split(','); htmlArray.push(''); } htmlArray.push(''); document.getElementById(tableID).innerHTML = htmlArray.join(''); } this.ShowSchedule = function (tableID) { if (teamCount == null) return; var htmlArray = new Array(); var sclassNameMap = new Map(); if (countSum != null && countSum.length > 0) { for (var i = 0; i < countSum.length; i++) { if (countSum[i][0] != 0) { sclassNameMap.set(countSum[i][0], countSum[i][1]); } } } htmlArray.push(''); htmlArray.push(_$("tplSubTech").innerHTML); for (var i = 0; i < teamCount.length; i++) { var displayStr = 'display: none;'; if (i >= (this.scheduleTechIndex - 1) * this.scheduleTechLength && i < this.scheduleTechIndex * this.scheduleTechLength) displayStr = ''; var oneData = teamCount[i]; var sclassLink = oneData[5].split('^')[dataLang]; var sclassFullName = sclassNameMap.get(oneData[4].toString()); var linkUrl = "/leagueinfo/" + oneData[4]; if (typeof (oneData[32]) != "undefined" && oneData[32] == 1) { sclassLink = "" + sclassLink+ ""; } var hNameClass = oneData[1] == selectTeamID ? "curTeam" : "othTeam"; var gNameClass = oneData[2] == selectTeamID ? "curTeam" : "othTeam"; var time = oneData[3].replace(/\/+/g, "-"); var clickEvent = `onclick="soccerInPage.detail(${oneData[0]},'${oneData[7]}','${oneData[8]}','${oneData[5]}')" style="cursor:pointer"` htmlArray.push('' + '' + ' '); } htmlArray.push(''); document.getElementById(tableID).innerHTML = htmlArray.join(''); this.maxShowLength = teamCount.length; ShowPage(this.scheduleTechIndex, parseInt(this.maxShowLength / this.scheduleTechLength) + 1); } function ShowPage(pageIndex, pageCount) { if (_moduleKey == "sagor" || _moduleKey == "tyso") { var pageHtml = "
    "; } else { var pageHtml = "
    "; } document.getElementById("page_div").innerHTML = pageHtml; fillPageSelect(pageCount, pageIndex); } function fillPageSelect(totalPage, curPage) { for (var i = 1; i < totalPage + 1; i++) { $('#pageIndexSelect').get(0).options.add(new Option(i, i)); if (curPage == i) { $('#pageIndexSelect').val(i); } } } this.showPageCountList = function (pageIndex) { if (typeof (pageIndex) == "undefined") { pageIndex = parseInt(document.getElementById("pageIndexSelect").value); } this.scheduleTechIndex = pageIndex; var trArr = $("tr[sclassID]", document.getElementById(tableID_schedule)); var showCount = 0; for (var i = 0; i < trArr.length; i++) { var onetr = trArr[i]; var tempSclassID = onetr.getAttribute("sclassID"); if (this.selSclassID == 0 || tempSclassID == this.selSclassID) { showCount++; if (showCount > (this.scheduleTechIndex - 1) * this.scheduleTechLength && showCount <= this.scheduleTechIndex * this.scheduleTechLength) onetr.style.display = ""; else onetr.style.display = "none"; } else onetr.style.display = "none"; } ShowPage(pageIndex, parseInt(this.maxShowLength / this.scheduleTechLength) + 1); } } function ClickTechType(selectDom) { var trArr = $("span[techtype]"); for (var i = 0; i < trArr.length; i++) { var onetr = trArr[i]; if (onetr == selectDom) { onetr.className = "btn on"; } else onetr.className = "btn"; } var techType = selectDom.getAttribute("techtype"); trArr = $("th[techtype]"); for (var i = 0; i < trArr.length; i++) { var onetr = trArr[i]; var tempTechtype = onetr.getAttribute("techtype"); if (tempTechtype == techType) { onetr.style.display = ""; } else onetr.style.display = "none"; } trArr = $("td[techtype]"); for (var i = 0; i < trArr.length; i++) { var onetr = trArr[i]; var tempTechtype = onetr.getAttribute("techtype"); if (tempTechtype == techType) { onetr.style.display = ""; } else onetr.style.display = "none"; } } //球队特性 function showCharacter() { try { if (!teamCharacter || teamCharacter.length < 1) return; var typeList = "1,3,2".split(','); var typeNameList = [_locModel.T.T_TeamAdvantage, _locModel.T.T_TeamStyle, _locModel.T.T_TeamWeakness]; var htmlArray = new Array(); htmlArray.push(" "); for (var i = 0; i < typeList.length; i++) { htmlArray.push(""); var count = 0; for (var j = 0; j < teamCharacter.length; j++) { var oneData = teamCharacter[j]; if (oneData[0] == typeList[i]) { if (count % 3 == 0) { htmlArray.push(""); if (count > 0) htmlArray.push(""); } var width = count % 3 < 2 ? "33%" : "34%"; htmlArray.push(''); count++; } } if (count % 3 == 1) htmlArray.push(''); else if (count % 3 == 2) htmlArray.push(''); } htmlArray.push("
    " + typeNameList[i] + "
    ' + oneData[2].split('^')[0] + '  
     
    "); document.getElementById("teamCharacterDiv").innerHTML = htmlArray.join(''); document.getElementById("teamCharacterTitle").style.display = ""; } catch (e) { } } ; function MathHelp() { this.Sum = function(list) { return eval(list.join("+")); } this.Avg = function(list, fixed) { return Divide(this.Sum(list), list.length, fixed); } this.Divide = function(dividend, divisor, fixed) { if (isNaN(divisor) || divisor == 0 || dividend == 0) return 0; var reValue = dividend / divisor; if (isNaN(fixed)) return reValue; else return reValue.toFixed(fixed); } } Number.prototype.toFixed = function (s) { changenum = (parseInt(this * Math.pow(10, s) + 0.5) / Math.pow(10, s)).toString(); return changenum; } function VerifyHelp() { this.IsArray=function(o) { return Object.prototype.toString.call(o) === '[object Array]'; } this.IsNum=function (s) { if (s != null && s != "") { return !isNaN(s); } return false; } } function $_(q, o) { if (typeof (q) !== 'string' || q == '') return []; var ss = q.split(' '); var attr = ''; var s = ss[0].split(':')[0]; if (s != ss[0]) attr = ss[0].split(':')[1]; var val = s.split('[')[0]; if (val != s) val = s.split('[')[1].replace(/[",\]]/g, ''); else val = ''; s = s.split('[')[0]; var obj = []; var sObj = null; o = o || document; switch (s.charAt(0)) { case '#': sObj = document.getElementById(s.substr(1)); if (sObj) obj.push(sObj); break; case '.': var l = o.getElementsByTagName('*'); var c = s.substr(1); for (var i = 0; i < l.length; i++) if (l[i].className.search('\\b' + c + '\\b') != -1) obj.push(l[i]); break; default: obj = o.getElementsByTagName(s); break; } if (val) { var l = []; var a = val.split('='); for (var i = 0; i < obj.length; i++) { switch (a.length) { case 1: if (obj[i].getAttribute(a[0]) != null) l.push(obj[i]); break; case 2: if (obj[i].getAttribute(a[0]) == a[1]) l.push(obj[i]); break; } } obj = l; } if (attr) { var l = []; for (var i = 0; i < obj.length; i++) if (obj[i][attr]) l.push(obj[i]); obj = l; } if (ss.length > 1) { var l = []; for (var i = 0; i < obj.length; i++) { var ll = arguments.callee(q.substr(ss[0].length + 1), obj[i]); if (ll.tagName) l.push(ll); else for (var j = 0; j < ll.length; j++) l.push(ll[j]); } obj = l; } if (sObj && ss.length == 1) { obj = sObj; if (obj) obj.length = 1; } else { var l = []; for (var i = 0; i < obj.length; i++) obj[i].$isAdd = false; for (var i = 0; i < obj.length; i++) { if (!obj[i].$isAdd) { obj[i].$isAdd = true; l.push(obj[i]); } } obj = l; } return obj; };