";
///////////////////////////////////////////////////////////////////////////////////
function display_postings() {
// Handle no postings situation
if (allPostings.length == 1) {
document.write(header);
document.write("
Watch for Top Jobs coming to this space soon.
");
document.write("");
return;
}
if (!FORM_DATA['topjobscount']) {
if (!topjobs_count) {
var displayCount = 5;
}
else {
var displayCount = topjobs_count;
}
}
else {
var displayCount = FORM_DATA['topjobscount'];
}
// Create target array
var displayPostings;
var allPostingsCount = allPostings.length;
var i;
if (displayCount == 99999) {
document.write(allHeader);
// Remember array entry 0 is placeholder, so start at index 1
for (i = 1; i < allPostingsCount; i++) {
if (!allPostings[i][1]) {
document.write("
");
}
}
// Display Employer Name only. If Employer name does not exist display Job Title
else if (topjobs_option == 2) {
for (i = 0; i < displayPostings.length; i++) {
if (!displayPostings[i][1]) {
document.write("
");
}
}
// Display Job Title followed by Employer Name. If Employer name does not exist display Job Description
else if (topjobs_option == 4) {
for (i = 0; i < displayPostings.length; i++) {
if (!displayPostings[i][1]) {
document.write("
");
}
}
}
// Display Job Title followed by Job Description
else if (topjobs_option == 5) {
for (i = 0; i < displayPostings.length; i++) {
document.write("
");
}
}
// Display Employer Name followed by Job Title. If Employer name does not exist display Job Description
else if (topjobs_option == 6) {
for (i = 0; i < displayPostings.length; i++) {
if (!displayPostings[i][1]) {
document.write("
");
}
}
}
// Display Employer Name followed by Job Description. If Employer name does not exist display Job Title
else if (topjobs_option == 7) {
for (i = 0; i < displayPostings.length; i++) {
if (!displayPostings[i][1]) {
document.write("
");
}
}
}
// Display Job Description followed by Job Title
else if (topjobs_option == 8) {
for (i = 0; i < displayPostings.length; i++) {
document.write("
");
}
}
// Display Job Description followed by Employer Name. If Employer name does not exist display Job Title
else if (topjobs_option == 9) {
for (i = 0; i < displayPostings.length; i++) {
if (!displayPostings[i][1]) {
document.write("
");
}
}
}
// Default to Job Title followed by Employer Name. If Employer name does not exist display Job Description
else {
for (i = 0; i < displayPostings.length; i++) {
if (!displayPostings[i][1]) {
document.write("
");
}
}
}
document.write(footer);
}
}
function createRequestObject() {
FORM_DATA = new Object();
// The Object (Array) where our data will be stored.
separator = ',';
// The token used to separate data from multi-select inputs
query = '' + this.location;
qu = query
// Get the current URL so we can parse out the data.
// Adding a null-string '' forces an implicit type cast
// from property to string, for NS2 compatibility.
query = query.substring((query.indexOf('?')) + 1);
// Keep everything after the question mark '?'.
if (query.length < 1) { return false; } // Perhaps we got some bad data?
keypairs = new Object();
numKP = 1;
// Local vars used to store and keep track of name/value pairs
// as we parse them back into a usable form.
while (query.indexOf('&') > -1) {
keypairs[numKP] = query.substring(0,query.indexOf('&'));
query = query.substring((query.indexOf('&')) + 1);
numKP++;
// Split the query string at each '&', storing the left-hand side
// of the split in a new keypairs[] holder, and chopping the query
// so that it gets the value of the right-hand string.
}
keypairs[numKP] = query;
// Store what's left in the query string as the final keypairs[] data.
for (i in keypairs) {
keyName = keypairs[i].substring(0,keypairs[i].indexOf('='));
// Left of '=' is name.
keyValue = keypairs[i].substring((keypairs[i].indexOf('=')) + 1);
// Right of '=' is value.
while (keyValue.indexOf('+') > -1) {
keyValue = keyValue.substring(0,keyValue.indexOf('+')) + ' ' + keyValue.substring(keyValue.indexOf('+') + 1);
// Replace each '+' in data string with a space.
}
keyValue = unescape(keyValue);
// Unescape non-alphanumerics
if (FORM_DATA[keyName]) {
FORM_DATA[keyName] = FORM_DATA[keyName] + separator + keyValue;
//document.write('The value of ' +keyName+ ' is:'+FORM_DATA[keyName]+' ');
// Object already exists, it is probably a multi-select input,
// and we need to generate a separator-delimited string
// by appending to what we already have stored.
}
else {
FORM_DATA[keyName] = keyValue;
//document.write('The value of ' +keyName+ ' is:'+FORM_DATA[keyName]+' ');
// Normal case: name gets value.
}
}
return FORM_DATA;
}
// MAINLINE
FORM_DATA = createRequestObject();
// This is the array/object containing the GET data.
// Retrieve information with 'FORM_DATA [ key ] = value'.
// Display jobs
display_postings();