function jobDescription() {
    var row = findParentRow();
    var job_title = row.cells(0).innerText;
    var job_description = row.cells(1).innerHTML;
    var job_requirements = row.cells(2).innerHTML;

    var POSITION_REQUIREMENTS = "Position Requirements";
    var html = "<FONT CLASS='body_title'>";

    html += job_title + "</FONT>"
    html += "<DIV CLASS='body_text'>" + job_description + "</DIV><BR>";
    html += "<FONT CLASS='body_bold'>" + POSITION_REQUIREMENTS + "</FONT>";
    html += "<DIV CLASS='body_text'>" + job_requirements + "</DIV>";

    createWindow(html, 500);
}

function closeWindow() {
    document.getElementById("floating_window").style.display = "none";
}

function jobLocation() {
    var row = findParentRow();
    var job_location = "<FONT CLASS='body_bold' style='font-size:14px'>Please send resume with salary requirements to:</FONT><br><br>" + row.cells(5).innerHTML;

    createWindow(job_location, 300);
}

function jobApply(ToAddress) {
    var row = findParentRow();
    var job_location = row.cells(3).innerText;
    var job_position = row.cells(0).innerText;

    document.jobInfo.ToAddress.value = ToAddress;
    document.jobInfo.Location.value = job_location;
    document.jobInfo.Position.value = job_position;
    document.jobInfo.submit();
}

function createWindow(content, width) {
    var html_div = document.getElementById("floating_window");

    html_div.children(0).rows(1).cells(0).innerHTML = content;
    html_div.style.display = "block";
    html_div.style.width = width;
    html_div.style.top = (document.body.clientHeight - html_div.offsetHeight) / 2;
    html_div.style.left = (document.body.clientWidth - html_div.offsetWidth) / 2;
}

function findParentRow() {
    var object = window.event.srcElement;

    while(object.tagName != "TR") {
        object = object.parentNode;
    }

    return object;
}

function feeschedule() {
    var row = findParentRow();
    var job_location = "<FONT CLASS='body_text' style='font-size:14px'>Pay By Phone Service Fee: $3.00<BR><BR>Pay Online Service Fee: $3.00</FONT><br><br>";

    createWindow(job_location, 300);
}
