// ==UserScript==
// @name http://ehire.51job.com/Candidate/ResumeViewBeta.aspx
// @namespace resume
// @description show accesskeys defined on page
// @include *ResumeViewBeta.aspx*
// ==/UserScript==
var interval = setInterval(resume, 1000);
function resume()
{
var nums = "一二三四五六七八九十";
var name = document.querySelector("#divResume table span b").innerHTML;
var arr = document.querySelector("#divResume table table tr:nth-of-type(2) span b").innerHTML.split("|");
var workYears = nums.indexOf(arr[0].substr(0, 1)) + 1;
var sex = arr[1].substr(6, 1);
var address = document.querySelector("#divResume table table tr:nth-of-type(2) tr:nth-of-type(2) td:nth-of-type(2)").innerHTML;
var phone = document.querySelector("#divResume table table tr:nth-of-type(3) td:nth-of-type(2)").innerHTML;
if(0== phone.indexOf("0"))
{
phone = phone.substr(1);
}
phone = parseInt(phone);
if (!phone)
{
phone = document.querySelector("#divResume table table tr:nth-of-type(4) td:nth-of-type(2)").innerHTML;
if(0== phone.indexOf("0"))
{
phone = phone.substr(1);
}
phone = parseInt(phone);
}
var company = document
.querySelector("#divResume table table:nth-of-type(2) tr:nth-of-type(1) tr:nth-of-type(2) td:nth-of-type(2)").innerHTML;
var workFunc = document
.querySelector("#divResume table table:nth-of-type(2) tr:nth-of-type(1) tr:nth-of-type(4) td:nth-of-type(2)").innerHTML;
var school = document
.querySelector("#divResume table table:nth-of-type(2) td:nth-of-type(3) tr:nth-of-type(4) td:nth-of-type(2)").innerHTML;
var major = document
.querySelector("#divResume table table:nth-of-type(2) td:nth-of-type(3) tr:nth-of-type(2) td:nth-of-type(2)").innerHTML;
var url = location.href;
var param = url.substr(url.indexOf("?")+1);
var id = param.split("&")[0].split("=")[1];
if (name && workYears && sex && company && workFunc && school && major)
{
var info = [ name, phone, major,school,workYears,company, address,'', workFunc,id ];
document.querySelector("#SubMenuHr").innerHTML = info.join("$");
clearInterval(interval);
}
}