function checkURL (e) { var doc = e.originalTarget; var loc = doc.location; try { if ( loc && loc.href ) { var reg = new RegExp("^http://www\\d?\\.cs-manager\\.com/csm/\\?p=(?:office_transfer|clan_players)(.*?)","i"); if ( loc.href.match(reg) ) { doPlayers(doc); } } } catch (ex) { } } function doPlayers (docu) { // Creates these variables: // total : Total skills // ls : Leadership // ep : Experience // stam : Stamina // tal : Talent // pname : Players full name // pnick : Players nick // pvalue: Players Value // page : Players Age var tables = docu.getElementsByTagName("table"); for (var i = 0; i < tables.length; i++) { var total = 0; if ( tables[i].className == "dev" && tables[i].getAttribute("cellspacing") == "0" && tables[i].getAttribute("cellpadding") == "0" ) { var skills = tables[i].getElementsByTagName("img"); for (var j = 0; j < skills.length; j++) { if ( skills[j].getAttribute("src").match("skill_bar") ) { var ts = skills[j].getAttribute("src").split("skill="); ts = ts[1].split("&"); total = total + parseInt(ts[0]); var jj = j; } if ( skills[j].getAttribute("title").match("Leadership") ) { var ls = skills[j].getAttribute("src").split("_"); ls = ls[1].split("."); var icode = j; } if ( skills[j].getAttribute("title").match("Experience") ) { var ep = skills[j].getAttribute("src").split("_"); ep = ep[1].split("."); } if ( skills[j].getAttribute("src").match("run_bar") ) { var stam = skills[j].getAttribute("src").split("_"); stam = stam[2].split("."); } if ( skills[j].getAttribute("src").match("star_bar") ) { var tal = skills[j].getAttribute("src").split("_"); tal = tal[2].split("."); } } var details = tables[i].getElementsByTagName("td"); for (var k = 0; k < details.length; k++) { if ( details[k].getAttribute("width").match("27") ) { var pname = details[k].innerHTML; } else if ( details[k].getAttribute("width").match("25") ) { var pvalue = details[k].innerHTML.split(" "); pvalue = parseInt(pvalue[0]+""+pvalue[1]); } else { if ( details[k].innerHTML.match("years") ) { var page = details[k].innerHTML.split(" "); page = page[0]; } } } var nick = tables[i].getElementsByTagName("a"); for (var m = 0; m < nick.length; m++) { if ( nick[m].getAttribute("href").match("&s=player") ) { var pnick = nick[m].innerHTML; } } totalp = Math.round(total/10); skills[jj].parentNode.parentNode.parentNode.innerHTML += "