function toggleCustomCompanySectorField()
{
        var obj = findObj( 'companySector');
        var isCustomSector = obj.value == obj.options[obj.length-1].value;
        findObj( "companySectorValue" ).disabled = !isCustomSector;
        findObj( "customCompanySectorBox" ).style.color = isCustomSector ? "black" : "gray";
        findObj("customCompanySectorRow").style.visibility = isCustomSector ? "visible" : "hidden";
	findObj("customCompanySectorRow").style.display = isCustomSector ? "block" : "none";
}

function adjustMailFields(checked)
{
        // Do not disable the fields, in this case their values won't be passed
        // back to the server; just hide them
        findObj("rowEmail").style.visibility = checked ? "hidden" : "visible";
        findObj("rowEmail").style.display = checked ? "none" : "block";
        findObj("rowEmail2").style.visibility = checked ? "hidden" : "visible";
        findObj("rowEmail2").style.display = checked ? "none" : "block";
        findObj("rowPassword").style.visibility = checked ? "hidden" : "visible";
        findObj("rowPassword").style.display = checked ? "none" : "block";
        findObj("rowPassword2").style.visibility = checked ? "hidden" : "visible";
        findObj("rowPassword2").style.display = checked ? "none" : "block";
}
