// JavaScript Document
function __updateSearch()

{

//finish it later

}



//__getPopUpSelectedValue

function __getPopUpSelectedValue(pIDStr)

{



var pObject=eval(document.getElementById(pIDStr));

//alert(pObject.type);

//alert(pObject.selectedIndex);

//alert(pObject.options[pObject.selectedIndex].value);

if(pObject){

if(pObject.type == "select-one") {

//alert(pObject.length);

if(pObject.length > 0){

if(pObject.options[pObject.selectedIndex].value != "Not specified"){

return pObject.options[pObject.selectedIndex].value;

}

}

}



if(pObject.type == "text") {

return pObject.value;

}





}



return "";

}

//__getPopUpSelectedValue





function __doJobSearch()

{



var keywords		= document.searchbox.section2.value.toLowerCase();

var searchStr		= "";

if(keywords == "") {

alert('Please enter job search keyword(s).');



} else {

keywords = keywords.replace(/\W/g, "-");

searchStr += keywords; //+ "-";

window.location = "search.php?keywords=" + searchStr;

}

}



function __doJobByLocationSearch()

{

var locationStr		= __getPopUpSelectedValue("location").toLowerCase();

var searchStr		= "";

if(locationStr == "") {

alert('Please select the job search location!');



} else {


if(searchStr.toLowerCase().indexOf(locationStr) == -1) { searchStr += locationStr; }

window.location = "search.php?Location=" + searchStr;


} 

}



function __doJobByJobRoleSearch()

{



var roleStr		= __getPopUpSelectedValue("role").toLowerCase();

var searchStr		= "";

if(roleStr == "") {

alert('Please select the job search role!');

} else {


if(searchStr.toLowerCase().indexOf(roleStr) == -1) { searchStr += roleStr.replace(/^\s+|\s+$/g, '');}


//document.location.href = "/search" + searchStr+ ".shtml?" + Math.random();

window.location = "search.php?Role=" + searchStr;


} 

}

