var whichObj = new Array();
    whichObj[1] = "surname";
    whichObj[2] = "firstName";
    whichObj[3] = "street";
    whichObj[4] = "postalCode";
    whichObj[5] = "town";
    whichObj[6] = "country";
    whichObj[7] = "homePhone";
    whichObj[8] = "mobilePhone";
    whichObj[9] = "email";
    whichObj[10] = "nationality";
    whichObj[11] = "dateOfBirth";
    whichObj[12] = "materialStatus";
    whichObj[13] = "earliestDate";
    whichObj[14] = "latestDate";
    whichObj[15] = "message";
    
function checkForX() {
	errVal = 1;
	
	sTpe = document.appForm.rankApplied;
    ObjName = sTpe[sTpe.selectedIndex].text;
    tObj = document.getElementById("so1");
    if (ObjName == "Please choose:") {
    	tObj.style.backgroundColor = "#cc0000"; tObj.style.color = "#ffffff"; errVal = 0;
    } else {
    	tObj.style.backgroundColor = "transparent"; tObj.style.color = "#000000";
    }
    
    for (i = 1; i <= 15; i++) {
    	ID = "t" + i;
    	thisObj = eval("document.appForm." + whichObj[i]);
    	tObj = document.getElementById(ID);
    	if (thisObj.value == "") {
    		tObj.style.backgroundColor = "#cc0000"; tObj.style.color = "#ffffff"; errVal = 0;
    	} else {
    		tObj.style.backgroundColor = "#ffffff"; tObj.style.color = "#444444"; 
    	}
    }
    
    sTpe = document.appForm.agencies;
    ObjName = sTpe[sTpe.selectedIndex].text;
    tObj = document.getElementById("so7");
    if (ObjName == "Please choose:") {
    	tObj.style.backgroundColor = "#cc0000"; tObj.style.color = "#ffffff"; errVal = 0;
    } else {
    	tObj.style.backgroundColor = "transparent"; tObj.style.color = "#000000";
    }	
    
    if (errVal == 0) {
    	alert("Please check your entries.\nAny red marked fields need to be completed!");
    } else {
    	//alert("Alles klar" + errVal);
        self.document.appForm.submit();
    }

}

function setLoginTxt() {
	mObj = document.getElementById("fjs");
	if (location.href == "http://www.bs-shipmanagement.com/login/" || location.href == "http://www.bs-shipmanagement.com/login/recruitment/my-candidates/") {
		if (mObj.className == "nosub") {
			mObj.innerHTML = "Login";
		}
	}
	if (location.href == "http://www.bs-shipmanagement.com/login/recruitment/open-positions/") {
		if (mObj.className == "enabled") {
			mObj.innerHTML = "Logout ";
		}
	}
}

// CREW SERVICE CENTRES MAP
function showMapDesc(ID) {
	mObj = document.getElementById(ID);
	mObj.style.display = "block";
}

function hideMapDesc(ID) {
	mObj = document.getElementById(ID);
	mObj.style.display = "none";
}